@webtides/element-library 0.1.0 → 0.1.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtides/element-library",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A set of web components built with @webtides/element-js",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -45,7 +45,6 @@
45
45
  "index.js",
46
46
  "custom-elements.json",
47
47
  "web-types.json",
48
- "patches",
49
48
  "CHANGELOG.md"
50
49
  ],
51
50
  "repository": {
@@ -97,7 +96,6 @@
97
96
  "husky": "^9.1.7",
98
97
  "lint-staged": "^17.0.7",
99
98
  "lit": "^3.3.3",
100
- "patch-package": "^8.0.1",
101
99
  "playwright": "^1.60.0",
102
100
  "prettier": "^3.8.3",
103
101
  "storybook": "^10.4.1",
@@ -117,8 +115,7 @@
117
115
  "analyze:watch": "cem analyze --config custom-elements-manifest.config.mjs --outdir . --watch",
118
116
  "build:types": "tsc -p tsconfig.json",
119
117
  "prepack": "npm run analyze && npm run build:types",
120
- "prepare": "husky && npm run analyze && npm run build:types",
121
- "postinstall": "patch-package"
118
+ "prepare": "husky && npm run analyze && npm run build:types"
122
119
  },
123
120
  "lint-staged": {
124
121
  "*.js": [
@@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
12
12
 
13
13
  ## Unreleased
14
14
 
15
+ ## [0.1.1] - 2026-06-04
16
+
17
+ ### Fixed
18
+
19
+ - The carousel now bundles in consumer projects. `ShadowHtml` deep-imported `@glidejs/glide/src/components/html`, whose pristine source does `import { exist, toArray } from '../utils/dom'` even though `dom.js` exports no `exist` — `esbuild`/Vite reject this as a hard error ("No matching export for import 'exist'"). `0.1.0` patched it via `patch-package`/`postinstall`, but a dependency's `postinstall` runs from its own nested directory and cannot reach the consumer's hoisted `@glidejs/glide`, so the patch never applied downstream (and the missing `patch-package` binary broke `npm install` outright). The fixed Glide `html.js` is now vendored as `glide/components/glide-html.js` (upstream verbatim minus the unused `exist` import) and `ShadowHtml` imports that copy, removing all reliance on patching consumers' `node_modules`.
20
+
15
21
  ## [0.1.0] - 2026-06-03
16
22
 
17
23
  ### Changed
@@ -1,4 +1,4 @@
1
- import GlideHTMLComponent from '@glidejs/glide/src/components/html';
1
+ import GlideHTMLComponent from './glide-html.js';
2
2
  import { define } from '@glidejs/glide/src/utils/object';
3
3
 
4
4
  const TRACK_SELECTOR = '[data-glide-el="track"]';
@@ -0,0 +1,108 @@
1
+ // Vendored from @glidejs/glide@3.6.2 (src/components/html.js), MIT License.
2
+ // https://github.com/glidejs/glide
3
+ //
4
+ // Only change vs. upstream: the unused `exist` named import was dropped — the
5
+ // pristine file does `import { exist, toArray } from '../utils/dom'`, but
6
+ // `dom.js` exports no `exist`, which bundlers such as esbuild/Vite reject as a
7
+ // hard error ("No matching export for import 'exist'"). The carousel deep-imports
8
+ // this component, so we vendor the fixed copy here instead of patching consumers'
9
+ // node_modules at install time. Relative util imports are re-pointed to the
10
+ // published package paths; the rest is upstream verbatim.
11
+ import { warn } from '@glidejs/glide/src/utils/log';
12
+ import { toArray } from '@glidejs/glide/src/utils/dom';
13
+ import { define } from '@glidejs/glide/src/utils/object';
14
+ import { isString } from '@glidejs/glide/src/utils/unit';
15
+
16
+ const TRACK_SELECTOR = '[data-glide-el="track"]';
17
+
18
+ export default function (Glide, Components, Events) {
19
+ const Html = {
20
+ /**
21
+ * Setup slider HTML nodes.
22
+ *
23
+ * @param {Glide} glide
24
+ */
25
+ mount() {
26
+ this.root = Glide.selector;
27
+ this.track = this.root.querySelector(TRACK_SELECTOR);
28
+ this.collectSlides();
29
+ },
30
+
31
+ /**
32
+ * Collect slides
33
+ */
34
+ collectSlides() {
35
+ this.slides = toArray(this.wrapper.children).filter((slide) => {
36
+ return !slide.classList.contains(Glide.settings.classes.slide.clone);
37
+ });
38
+ },
39
+ };
40
+
41
+ define(Html, 'root', {
42
+ /**
43
+ * Gets node of the glide main element.
44
+ *
45
+ * @return {Object}
46
+ */
47
+ get() {
48
+ return Html._r;
49
+ },
50
+
51
+ /**
52
+ * Sets node of the glide main element.
53
+ *
54
+ * @return {Object}
55
+ */
56
+ set(r) {
57
+ if (isString(r)) {
58
+ r = document.querySelector(r);
59
+ }
60
+
61
+ if (r !== null) {
62
+ Html._r = r;
63
+ } else {
64
+ warn('Root element must be a existing Html node');
65
+ }
66
+ },
67
+ });
68
+
69
+ define(Html, 'track', {
70
+ /**
71
+ * Gets node of the glide track with slides.
72
+ *
73
+ * @return {Object}
74
+ */
75
+ get() {
76
+ return Html._t;
77
+ },
78
+
79
+ /**
80
+ * Sets node of the glide track with slides.
81
+ *
82
+ * @return {Object}
83
+ */
84
+ set(t) {
85
+ Html._t = t;
86
+ },
87
+ });
88
+
89
+ define(Html, 'wrapper', {
90
+ /**
91
+ * Gets node of the slides wrapper.
92
+ *
93
+ * @return {Object}
94
+ */
95
+ get() {
96
+ return Html.track.children[0];
97
+ },
98
+ });
99
+
100
+ /**
101
+ * Add/remove/reorder dynamic slides
102
+ */
103
+ Events.on('update', () => {
104
+ Html.collectSlides();
105
+ });
106
+
107
+ return Html;
108
+ }
@@ -1 +1,4 @@
1
- export default function _default(Glide: any, Components: any, Events: any): any;
1
+ export default function _default(Glide: any, Components: any, Events: any): {
2
+ mount(): void;
3
+ collectSlides(): void;
4
+ };
@@ -0,0 +1,12 @@
1
+ export default function _default(Glide: any, Components: any, Events: any): {
2
+ /**
3
+ * Setup slider HTML nodes.
4
+ *
5
+ * @param {Glide} glide
6
+ */
7
+ mount(): void;
8
+ /**
9
+ * Collect slides
10
+ */
11
+ collectSlides(): void;
12
+ };