@bikdotai/bik-component-library 0.0.804-beta.10 → 0.0.804-beta.11

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createSuggestionPopup=function(e,t){const o=document.createElement("div");function n(e){const t=null==e?void 0:e();t&&(o.style.left=`${t.left}px`,o.style.top=`${t.bottom+4}px`)}return o.style.cssText="position:fixed;z-index:9999;left:0;top:0;pointer-events:auto;",o.appendChild(e),document.body.appendChild(o),n(t),{element:o,show(){o.style.display=""},hide(){o.style.display="none"},destroy(){o.remove()},updatePosition(e){n(e)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.createSuggestionPopup=function(e,t){const o=document.createElement("div");function n(e){const t=null==e?void 0:e();if(!t)return;const n=o.offsetHeight,i=o.offsetWidth,s=window.innerHeight,d=window.innerWidth,p=s-t.bottom-4,l=t.top-4,r=p>=n?t.bottom+4:l>=n?t.top-4-n:4,u=Math.min(t.left,d-i-4);o.style.left=`${Math.max(4,u)}px`,o.style.top=`${r}px`}return o.style.cssText="position:fixed;z-index:9999;pointer-events:auto;",o.appendChild(e),document.body.appendChild(o),n(t),{element:o,show(){o.style.display=""},hide(){o.style.display="none"},destroy(){o.remove()},updatePosition(e){n(e)}}};
2
2
  //# sourceMappingURL=suggestionPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestionPopup.js","sources":["../../../../src/editor/extensions/suggestionPopup.ts"],"sourcesContent":["/**\n * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).\n * Replaces tippy.js — all we need is a positioned container near the cursor.\n */\n\nexport interface SuggestionPopup {\n\tshow(): void;\n\thide(): void;\n\tdestroy(): void;\n\tupdatePosition(clientRect: () => DOMRect | null): void;\n\treadonly element: HTMLDivElement;\n}\n\nexport function createSuggestionPopup(\n\tcontent: HTMLElement,\n\tclientRect: (() => DOMRect | null) | null,\n): SuggestionPopup {\n\tconst wrapper = document.createElement('div');\n\twrapper.style.cssText =\n\t\t'position:fixed;z-index:9999;left:0;top:0;pointer-events:auto;';\n\twrapper.appendChild(content);\n\tdocument.body.appendChild(wrapper);\n\n\tfunction reposition(getRectFn: (() => DOMRect | null) | null) {\n\t\tconst rect = getRectFn?.();\n\t\tif (!rect) return;\n\t\twrapper.style.left = `${rect.left}px`;\n\t\twrapper.style.top = `${rect.bottom + 4}px`;\n\t}\n\n\treposition(clientRect);\n\n\treturn {\n\t\telement: wrapper,\n\t\tshow() {\n\t\t\twrapper.style.display = '';\n\t\t},\n\t\thide() {\n\t\t\twrapper.style.display = 'none';\n\t\t},\n\t\tdestroy() {\n\t\t\twrapper.remove();\n\t\t},\n\t\tupdatePosition(getRectFn: () => DOMRect | null) {\n\t\t\treposition(getRectFn);\n\t\t},\n\t};\n}\n"],"names":["content","clientRect","wrapper","document","createElement","reposition","getRectFn","rect","style","left","top","bottom","cssText","appendChild","body","element","show","display","hide","destroy","remove","updatePosition"],"mappings":"kGAagB,SACfA,EACAC,GAEA,MAAMC,EAAUC,SAASC,cAAc,OAMvC,SAASC,EAAWC,GACnB,MAAMC,EAAOD,aAAA,EAAAA,IACRC,IACLL,EAAQM,MAAMC,QAAUF,EAAKE,SAC7BP,EAAQM,MAAME,IAAM,GAAGH,EAAKI,OAAS,MACtC,CAIA,OAdAT,EAAQM,MAAMI,QACb,gEACDV,EAAQW,YAAYb,GACpBG,SAASW,KAAKD,YAAYX,GAS1BG,EAAWJ,GAEJ,CACNc,QAASb,EACTc,OACCd,EAAQM,MAAMS,QAAU,EACxB,EACDC,OACChB,EAAQM,MAAMS,QAAU,MACxB,EACDE,UACCjB,EAAQkB,QACR,EACDC,eAAef,GACdD,EAAWC,EACZ,EAEF"}
1
+ {"version":3,"file":"suggestionPopup.js","sources":["../../../../src/editor/extensions/suggestionPopup.ts"],"sourcesContent":["/**\n * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).\n * Replaces tippy.js — all we need is a positioned container near the cursor\n * that flips above when there isn't enough room below.\n */\n\nconst GAP = 4;\n\nexport interface SuggestionPopup {\n\tshow(): void;\n\thide(): void;\n\tdestroy(): void;\n\tupdatePosition(clientRect: () => DOMRect | null): void;\n\treadonly element: HTMLDivElement;\n}\n\nexport function createSuggestionPopup(\n\tcontent: HTMLElement,\n\tclientRect: (() => DOMRect | null) | null,\n): SuggestionPopup {\n\tconst wrapper = document.createElement('div');\n\twrapper.style.cssText = 'position:fixed;z-index:9999;pointer-events:auto;';\n\twrapper.appendChild(content);\n\tdocument.body.appendChild(wrapper);\n\n\tfunction reposition(getRectFn: (() => DOMRect | null) | null) {\n\t\tconst rect = getRectFn?.();\n\t\tif (!rect) return;\n\n\t\tconst popupHeight = wrapper.offsetHeight;\n\t\tconst popupWidth = wrapper.offsetWidth;\n\t\tconst viewportH = window.innerHeight;\n\t\tconst viewportW = window.innerWidth;\n\n\t\tconst spaceBelow = viewportH - rect.bottom - GAP;\n\t\tconst spaceAbove = rect.top - GAP;\n\t\tconst fitsBelow = spaceBelow >= popupHeight;\n\n\t\tconst top = fitsBelow\n\t\t\t? rect.bottom + GAP\n\t\t\t: spaceAbove >= popupHeight\n\t\t\t? rect.top - GAP - popupHeight\n\t\t\t: GAP;\n\n\t\tconst left = Math.min(rect.left, viewportW - popupWidth - GAP);\n\n\t\twrapper.style.left = `${Math.max(GAP, left)}px`;\n\t\twrapper.style.top = `${top}px`;\n\t}\n\n\treposition(clientRect);\n\n\treturn {\n\t\telement: wrapper,\n\t\tshow() {\n\t\t\twrapper.style.display = '';\n\t\t},\n\t\thide() {\n\t\t\twrapper.style.display = 'none';\n\t\t},\n\t\tdestroy() {\n\t\t\twrapper.remove();\n\t\t},\n\t\tupdatePosition(getRectFn: () => DOMRect | null) {\n\t\t\treposition(getRectFn);\n\t\t},\n\t};\n}\n"],"names":["content","clientRect","wrapper","document","createElement","reposition","getRectFn","rect","popupHeight","offsetHeight","popupWidth","offsetWidth","viewportH","window","innerHeight","viewportW","innerWidth","spaceBelow","bottom","spaceAbove","top","left","Math","min","style","max","cssText","appendChild","body","element","show","display","hide","destroy","remove","updatePosition"],"mappings":"kGAgBgB,SACfA,EACAC,GAEA,MAAMC,EAAUC,SAASC,cAAc,OAKvC,SAASC,EAAWC,GACnB,MAAMC,EAAOD,aAAA,EAAAA,IACb,IAAKC,EAAM,OAEX,MAAMC,EAAcN,EAAQO,aACtBC,EAAaR,EAAQS,YACrBC,EAAYC,OAAOC,YACnBC,EAAYF,OAAOG,WAEnBC,EAAaL,EAAYL,EAAKW,OA5B1B,EA6BJC,EAAaZ,EAAKa,IA7Bd,EAgCJA,EAFYH,GAAcT,EAG7BD,EAAKW,OAjCE,EAkCPC,GAAcX,EACdD,EAAKa,IAnCE,EAmCUZ,EAnCV,EAsCJa,EAAOC,KAAKC,IAAIhB,EAAKc,KAAMN,EAAYL,EAtCnC,GAwCVR,EAAQsB,MAAMH,KAAU,GAAAC,KAAKG,IAxCnB,EAwC4BJ,OACtCnB,EAAQsB,MAAMJ,IAAS,GAAAA,KACxB,CAIA,OA/BAlB,EAAQsB,MAAME,QAAU,mDACxBxB,EAAQyB,YAAY3B,GACpBG,SAASyB,KAAKD,YAAYzB,GA2B1BG,EAAWJ,GAEJ,CACN4B,QAAS3B,EACT4B,OACC5B,EAAQsB,MAAMO,QAAU,EACxB,EACDC,OACC9B,EAAQsB,MAAMO,QAAU,MACxB,EACDE,UACC/B,EAAQgC,QACR,EACDC,eAAe7B,GACdD,EAAWC,EACZ,EAEF"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).
3
- * Replaces tippy.js — all we need is a positioned container near the cursor.
3
+ * Replaces tippy.js — all we need is a positioned container near the cursor
4
+ * that flips above when there isn't enough room below.
4
5
  */
5
6
  export interface SuggestionPopup {
6
7
  show(): void;
@@ -1,2 +1,2 @@
1
- function e(e,t){const o=document.createElement("div");function n(e){const t=null==e?void 0:e();t&&(o.style.left=`${t.left}px`,o.style.top=`${t.bottom+4}px`)}return o.style.cssText="position:fixed;z-index:9999;left:0;top:0;pointer-events:auto;",o.appendChild(e),document.body.appendChild(o),n(t),{element:o,show(){o.style.display=""},hide(){o.style.display="none"},destroy(){o.remove()},updatePosition(e){n(e)}}}export{e as createSuggestionPopup};
1
+ function t(t,e){const o=document.createElement("div");function n(t){const e=null==t?void 0:t();if(!e)return;const n=o.offsetHeight,i=o.offsetWidth,d=window.innerHeight,s=window.innerWidth,l=d-e.bottom-4,p=e.top-4,r=l>=n?e.bottom+4:p>=n?e.top-4-n:4,a=Math.min(e.left,s-i-4);o.style.left=`${Math.max(4,a)}px`,o.style.top=`${r}px`}return o.style.cssText="position:fixed;z-index:9999;pointer-events:auto;",o.appendChild(t),document.body.appendChild(o),n(e),{element:o,show(){o.style.display=""},hide(){o.style.display="none"},destroy(){o.remove()},updatePosition(t){n(t)}}}export{t as createSuggestionPopup};
2
2
  //# sourceMappingURL=suggestionPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestionPopup.js","sources":["../../../../src/editor/extensions/suggestionPopup.ts"],"sourcesContent":["/**\n * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).\n * Replaces tippy.js — all we need is a positioned container near the cursor.\n */\n\nexport interface SuggestionPopup {\n\tshow(): void;\n\thide(): void;\n\tdestroy(): void;\n\tupdatePosition(clientRect: () => DOMRect | null): void;\n\treadonly element: HTMLDivElement;\n}\n\nexport function createSuggestionPopup(\n\tcontent: HTMLElement,\n\tclientRect: (() => DOMRect | null) | null,\n): SuggestionPopup {\n\tconst wrapper = document.createElement('div');\n\twrapper.style.cssText =\n\t\t'position:fixed;z-index:9999;left:0;top:0;pointer-events:auto;';\n\twrapper.appendChild(content);\n\tdocument.body.appendChild(wrapper);\n\n\tfunction reposition(getRectFn: (() => DOMRect | null) | null) {\n\t\tconst rect = getRectFn?.();\n\t\tif (!rect) return;\n\t\twrapper.style.left = `${rect.left}px`;\n\t\twrapper.style.top = `${rect.bottom + 4}px`;\n\t}\n\n\treposition(clientRect);\n\n\treturn {\n\t\telement: wrapper,\n\t\tshow() {\n\t\t\twrapper.style.display = '';\n\t\t},\n\t\thide() {\n\t\t\twrapper.style.display = 'none';\n\t\t},\n\t\tdestroy() {\n\t\t\twrapper.remove();\n\t\t},\n\t\tupdatePosition(getRectFn: () => DOMRect | null) {\n\t\t\treposition(getRectFn);\n\t\t},\n\t};\n}\n"],"names":["createSuggestionPopup","content","clientRect","wrapper","document","createElement","reposition","getRectFn","rect","style","left","top","bottom","cssText","appendChild","body","element","show","display","hide","destroy","remove","updatePosition"],"mappings":"AAagB,SAAAA,EACfC,EACAC,GAEA,MAAMC,EAAUC,SAASC,cAAc,OAMvC,SAASC,EAAWC,GACnB,MAAMC,EAAOD,aAAA,EAAAA,IACRC,IACLL,EAAQM,MAAMC,QAAUF,EAAKE,SAC7BP,EAAQM,MAAME,IAAM,GAAGH,EAAKI,OAAS,MACtC,CAIA,OAdAT,EAAQM,MAAMI,QACb,gEACDV,EAAQW,YAAYb,GACpBG,SAASW,KAAKD,YAAYX,GAS1BG,EAAWJ,GAEJ,CACNc,QAASb,EACTc,OACCd,EAAQM,MAAMS,QAAU,EACxB,EACDC,OACChB,EAAQM,MAAMS,QAAU,MACxB,EACDE,UACCjB,EAAQkB,QACR,EACDC,eAAef,GACdD,EAAWC,EACZ,EAEF"}
1
+ {"version":3,"file":"suggestionPopup.js","sources":["../../../../src/editor/extensions/suggestionPopup.ts"],"sourcesContent":["/**\n * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).\n * Replaces tippy.js — all we need is a positioned container near the cursor\n * that flips above when there isn't enough room below.\n */\n\nconst GAP = 4;\n\nexport interface SuggestionPopup {\n\tshow(): void;\n\thide(): void;\n\tdestroy(): void;\n\tupdatePosition(clientRect: () => DOMRect | null): void;\n\treadonly element: HTMLDivElement;\n}\n\nexport function createSuggestionPopup(\n\tcontent: HTMLElement,\n\tclientRect: (() => DOMRect | null) | null,\n): SuggestionPopup {\n\tconst wrapper = document.createElement('div');\n\twrapper.style.cssText = 'position:fixed;z-index:9999;pointer-events:auto;';\n\twrapper.appendChild(content);\n\tdocument.body.appendChild(wrapper);\n\n\tfunction reposition(getRectFn: (() => DOMRect | null) | null) {\n\t\tconst rect = getRectFn?.();\n\t\tif (!rect) return;\n\n\t\tconst popupHeight = wrapper.offsetHeight;\n\t\tconst popupWidth = wrapper.offsetWidth;\n\t\tconst viewportH = window.innerHeight;\n\t\tconst viewportW = window.innerWidth;\n\n\t\tconst spaceBelow = viewportH - rect.bottom - GAP;\n\t\tconst spaceAbove = rect.top - GAP;\n\t\tconst fitsBelow = spaceBelow >= popupHeight;\n\n\t\tconst top = fitsBelow\n\t\t\t? rect.bottom + GAP\n\t\t\t: spaceAbove >= popupHeight\n\t\t\t? rect.top - GAP - popupHeight\n\t\t\t: GAP;\n\n\t\tconst left = Math.min(rect.left, viewportW - popupWidth - GAP);\n\n\t\twrapper.style.left = `${Math.max(GAP, left)}px`;\n\t\twrapper.style.top = `${top}px`;\n\t}\n\n\treposition(clientRect);\n\n\treturn {\n\t\telement: wrapper,\n\t\tshow() {\n\t\t\twrapper.style.display = '';\n\t\t},\n\t\thide() {\n\t\t\twrapper.style.display = 'none';\n\t\t},\n\t\tdestroy() {\n\t\t\twrapper.remove();\n\t\t},\n\t\tupdatePosition(getRectFn: () => DOMRect | null) {\n\t\t\treposition(getRectFn);\n\t\t},\n\t};\n}\n"],"names":["createSuggestionPopup","content","clientRect","wrapper","document","createElement","reposition","getRectFn","rect","popupHeight","offsetHeight","popupWidth","offsetWidth","viewportH","window","innerHeight","viewportW","innerWidth","spaceBelow","bottom","spaceAbove","top","left","Math","min","style","max","cssText","appendChild","body","element","show","display","hide","destroy","remove","updatePosition"],"mappings":"AAgBgB,SAAAA,EACfC,EACAC,GAEA,MAAMC,EAAUC,SAASC,cAAc,OAKvC,SAASC,EAAWC,GACnB,MAAMC,EAAOD,aAAA,EAAAA,IACb,IAAKC,EAAM,OAEX,MAAMC,EAAcN,EAAQO,aACtBC,EAAaR,EAAQS,YACrBC,EAAYC,OAAOC,YACnBC,EAAYF,OAAOG,WAEnBC,EAAaL,EAAYL,EAAKW,OA5B1B,EA6BJC,EAAaZ,EAAKa,IA7Bd,EAgCJA,EAFYH,GAAcT,EAG7BD,EAAKW,OAjCE,EAkCPC,GAAcX,EACdD,EAAKa,IAnCE,EAmCUZ,EAnCV,EAsCJa,EAAOC,KAAKC,IAAIhB,EAAKc,KAAMN,EAAYL,EAtCnC,GAwCVR,EAAQsB,MAAMH,KAAU,GAAAC,KAAKG,IAxCnB,EAwC4BJ,OACtCnB,EAAQsB,MAAMJ,IAAS,GAAAA,KACxB,CAIA,OA/BAlB,EAAQsB,MAAME,QAAU,mDACxBxB,EAAQyB,YAAY3B,GACpBG,SAASyB,KAAKD,YAAYzB,GA2B1BG,EAAWJ,GAEJ,CACN4B,QAAS3B,EACT4B,OACC5B,EAAQsB,MAAMO,QAAU,EACxB,EACDC,OACC9B,EAAQsB,MAAMO,QAAU,MACxB,EACDE,UACC/B,EAAQgC,QACR,EACDC,eAAe7B,GACdD,EAAWC,EACZ,EAEF"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).
3
- * Replaces tippy.js — all we need is a positioned container near the cursor.
3
+ * Replaces tippy.js — all we need is a positioned container near the cursor
4
+ * that flips above when there isn't enough room below.
4
5
  */
5
6
  export interface SuggestionPopup {
6
7
  show(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.804-beta.10",
3
+ "version": "0.0.804-beta.11",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",