@foldkit/ui 0.162.0-canary.01d0205a4e2b → 0.162.0-canary.a1fe8ab50a2a

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.
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAkCnD;;;;;;0DAM0D;AAC1D,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAWpE,CAAA;AAUD;;;;;;;;;;;;;;;;;;;;;0BAqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAgPb,CAAA"}
1
+ {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAkCnD;;;;;;0DAM0D;AAC1D,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAWpE,CAAA;AAUD;;;;;;;;;;;;;;;;;;;;;0BAqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAkQb,CAAA"}
@@ -136,8 +136,17 @@ export const anchorSetup = (element, config) => {
136
136
  const root = element.getRootNode();
137
137
  const inShadow = root instanceof ShadowRoot;
138
138
  const owner = inShadow ? root : document;
139
+ if (!(element instanceof HTMLElement)) {
140
+ console.error('[@foldkit/ui] anchorSetup requires an HTML panel. The panel will not be positioned.');
141
+ return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
142
+ }
139
143
  const button = owner.getElementById(config.buttonId);
140
- if (!(button instanceof HTMLElement) || !(element instanceof HTMLElement)) {
144
+ if (button === null) {
145
+ console.error(`[@foldkit/ui] anchorSetup could not find a trigger with id "${config.buttonId}". The panel will not be positioned.`);
146
+ return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
147
+ }
148
+ if (!(button instanceof HTMLElement)) {
149
+ console.error(`[@foldkit/ui] anchorSetup requires an HTML trigger with id "${config.buttonId}". The panel will not be positioned.`);
141
150
  return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
142
151
  }
143
152
  const isPortal = config.anchor.portal ?? true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/ui",
3
- "version": "0.162.0-canary.01d0205a4e2b",
3
+ "version": "0.162.0-canary.a1fe8ab50a2a",
4
4
  "description": "Headless, accessible UI components for Foldkit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -122,7 +122,7 @@
122
122
  ],
123
123
  "peerDependencies": {
124
124
  "effect": "4.0.0-rc.115",
125
- "foldkit": "0.162.0-canary.01d0205a4e2b"
125
+ "foldkit": "0.162.0-canary.a1fe8ab50a2a"
126
126
  },
127
127
  "dependencies": {
128
128
  "@floating-ui/dom": "^1.8.0"
@@ -134,8 +134,8 @@
134
134
  "rimraf": "^6.1.3",
135
135
  "typescript": "^7.0.2",
136
136
  "vitest": "^5.0.0",
137
- "@foldkit/vite-plugin": "0.23.0-canary.01d0205a4e2b",
138
- "foldkit": "0.162.0-canary.01d0205a4e2b"
137
+ "@foldkit/vite-plugin": "0.23.0-canary.a1fe8ab50a2a",
138
+ "foldkit": "0.162.0-canary.a1fe8ab50a2a"
139
139
  },
140
140
  "keywords": [
141
141
  "foldkit",