flexium 0.10.7 → 0.12.6
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/README.md +10 -10
- package/dist/canvas.d.cts +83 -23
- package/dist/canvas.d.ts +83 -23
- package/dist/canvas.js +1 -1
- package/dist/canvas.js.map +1 -1
- package/dist/canvas.mjs +1 -1
- package/dist/canvas.mjs.map +1 -1
- package/dist/chunk-44RZHCII.mjs +2 -0
- package/dist/chunk-44RZHCII.mjs.map +1 -0
- package/dist/chunk-7BXR4ZFD.js +2 -0
- package/dist/chunk-7BXR4ZFD.js.map +1 -0
- package/dist/chunk-7DXFHPWZ.mjs +2 -0
- package/dist/chunk-7DXFHPWZ.mjs.map +1 -0
- package/dist/chunk-ALTO2MGI.js +2 -0
- package/dist/chunk-ALTO2MGI.js.map +1 -0
- package/dist/chunk-C452JE6C.js +2 -0
- package/dist/chunk-C452JE6C.js.map +1 -0
- package/dist/chunk-CPJRQL2C.mjs +2 -0
- package/dist/chunk-CPJRQL2C.mjs.map +1 -0
- package/dist/chunk-EJ7Z5OMU.mjs +2 -0
- package/dist/chunk-EJ7Z5OMU.mjs.map +1 -0
- package/dist/chunk-ENWGYQNU.js +2 -0
- package/dist/chunk-ENWGYQNU.js.map +1 -0
- package/dist/chunk-EXLNKYSH.js +2 -0
- package/dist/chunk-EXLNKYSH.js.map +1 -0
- package/dist/chunk-LUREDEUB.mjs +2 -0
- package/dist/chunk-LUREDEUB.mjs.map +1 -0
- package/dist/chunk-LUW7DIEW.js +2 -0
- package/dist/chunk-LUW7DIEW.js.map +1 -0
- package/dist/chunk-ZCO4NIGC.mjs +2 -0
- package/dist/chunk-ZCO4NIGC.mjs.map +1 -0
- package/dist/core.d.cts +41 -2
- package/dist/core.d.ts +41 -2
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/dom.d.cts +10 -33
- package/dist/dom.d.ts +10 -33
- package/dist/dom.js +1 -1
- package/dist/dom.js.map +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/dom.mjs.map +1 -1
- package/dist/index.d.cts +1 -24
- package/dist/index.d.ts +1 -24
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interactive.d.cts +65 -148
- package/dist/interactive.d.ts +65 -148
- package/dist/interactive.js +1 -1
- package/dist/interactive.js.map +1 -1
- package/dist/interactive.mjs +1 -1
- package/dist/interactive.mjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +6 -2
- package/dist/jsx-dev-runtime.d.ts +6 -2
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/jsx-dev-runtime.mjs.map +1 -1
- package/dist/jsx-runtime.d.cts +6 -68
- package/dist/jsx-runtime.d.ts +6 -68
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/router.d.cts +48 -15
- package/dist/router.d.ts +48 -15
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/router.mjs +1 -1
- package/dist/router.mjs.map +1 -1
- package/package.json +13 -53
- package/dist/DrawText-CVAKQ5wZ.d.cts +0 -309
- package/dist/DrawText-Dlh1L1Ar.d.ts +0 -309
- package/dist/Motion-BrOAJzgH.d.cts +0 -87
- package/dist/Motion-BrOAJzgH.d.ts +0 -87
- package/dist/advanced.d.cts +0 -32
- package/dist/advanced.d.ts +0 -32
- package/dist/advanced.js +0 -2
- package/dist/advanced.js.map +0 -1
- package/dist/advanced.mjs +0 -2
- package/dist/advanced.mjs.map +0 -1
- package/dist/chunk-5ICRQIS2.js +0 -3
- package/dist/chunk-5ICRQIS2.js.map +0 -1
- package/dist/chunk-5K55ASOD.mjs +0 -3
- package/dist/chunk-5K55ASOD.mjs.map +0 -1
- package/dist/chunk-AZEHBSBG.js +0 -3
- package/dist/chunk-AZEHBSBG.js.map +0 -1
- package/dist/chunk-BBNYMXE7.mjs +0 -2
- package/dist/chunk-BBNYMXE7.mjs.map +0 -1
- package/dist/chunk-BYHIHYRR.mjs +0 -2
- package/dist/chunk-BYHIHYRR.mjs.map +0 -1
- package/dist/chunk-DZ7L3SHV.js +0 -2
- package/dist/chunk-DZ7L3SHV.js.map +0 -1
- package/dist/chunk-ECYYIQEX.mjs +0 -3
- package/dist/chunk-ECYYIQEX.mjs.map +0 -1
- package/dist/chunk-FDMJHFN7.mjs +0 -2
- package/dist/chunk-FDMJHFN7.mjs.map +0 -1
- package/dist/chunk-GKJQEOP7.mjs +0 -2
- package/dist/chunk-GKJQEOP7.mjs.map +0 -1
- package/dist/chunk-GYDP6MFV.js +0 -3
- package/dist/chunk-GYDP6MFV.js.map +0 -1
- package/dist/chunk-HB5VPQTB.mjs +0 -2
- package/dist/chunk-HB5VPQTB.mjs.map +0 -1
- package/dist/chunk-KNF5ERPK.mjs +0 -2
- package/dist/chunk-KNF5ERPK.mjs.map +0 -1
- package/dist/chunk-OPAAGNBO.mjs +0 -2
- package/dist/chunk-OPAAGNBO.mjs.map +0 -1
- package/dist/chunk-OPAQ4R4M.mjs +0 -2
- package/dist/chunk-OPAQ4R4M.mjs.map +0 -1
- package/dist/chunk-Q7IWDVJ4.js +0 -2
- package/dist/chunk-Q7IWDVJ4.js.map +0 -1
- package/dist/chunk-QPCIDSMM.js +0 -2
- package/dist/chunk-QPCIDSMM.js.map +0 -1
- package/dist/chunk-QZIX4FXS.mjs +0 -2
- package/dist/chunk-QZIX4FXS.mjs.map +0 -1
- package/dist/chunk-RMN5IPS5.js +0 -2
- package/dist/chunk-RMN5IPS5.js.map +0 -1
- package/dist/chunk-U6C6VDVZ.js +0 -2
- package/dist/chunk-U6C6VDVZ.js.map +0 -1
- package/dist/chunk-WQFQO5LK.js +0 -2
- package/dist/chunk-WQFQO5LK.js.map +0 -1
- package/dist/chunk-WVEJT7HD.mjs +0 -2
- package/dist/chunk-WVEJT7HD.mjs.map +0 -1
- package/dist/chunk-WWEWRI6S.js +0 -2
- package/dist/chunk-WWEWRI6S.js.map +0 -1
- package/dist/chunk-XJHWMHKF.js +0 -2
- package/dist/chunk-XJHWMHKF.js.map +0 -1
- package/dist/chunk-Y6KKAHLS.mjs +0 -3
- package/dist/chunk-Y6KKAHLS.mjs.map +0 -1
- package/dist/chunk-YDZ37ZZ4.js +0 -2
- package/dist/chunk-YDZ37ZZ4.js.map +0 -1
- package/dist/chunk-YPVRQKMW.js +0 -2
- package/dist/chunk-YPVRQKMW.js.map +0 -1
- package/dist/components-BMbqsbMY.d.cts +0 -126
- package/dist/components-C83mBQXW.d.ts +0 -126
- package/dist/core-CxHP8991.d.cts +0 -32
- package/dist/core-D0ggvjX3.d.ts +0 -32
- package/dist/effect-554ONNZR.js +0 -2
- package/dist/effect-554ONNZR.js.map +0 -1
- package/dist/effect-T2GVIS3T.mjs +0 -2
- package/dist/effect-T2GVIS3T.mjs.map +0 -1
- package/dist/owner-QS9tPwPr.d.cts +0 -27
- package/dist/owner-QS9tPwPr.d.ts +0 -27
- package/dist/portal-BK_0Z0hE.d.cts +0 -206
- package/dist/portal-CbguxtuQ.d.ts +0 -206
- package/dist/primitives/layout.d.cts +0 -295
- package/dist/primitives/layout.d.ts +0 -295
- package/dist/primitives/layout.js +0 -2
- package/dist/primitives/layout.js.map +0 -1
- package/dist/primitives/layout.mjs +0 -2
- package/dist/primitives/layout.mjs.map +0 -1
- package/dist/primitives/motion.d.cts +0 -230
- package/dist/primitives/motion.d.ts +0 -230
- package/dist/primitives/motion.js +0 -2
- package/dist/primitives/motion.js.map +0 -1
- package/dist/primitives/motion.mjs +0 -2
- package/dist/primitives/motion.mjs.map +0 -1
- package/dist/primitives/ui.d.cts +0 -81
- package/dist/primitives/ui.d.ts +0 -81
- package/dist/primitives/ui.js +0 -2
- package/dist/primitives/ui.js.map +0 -1
- package/dist/primitives/ui.mjs +0 -2
- package/dist/primitives/ui.mjs.map +0 -1
- package/dist/primitives.d.cts +0 -93
- package/dist/primitives.d.ts +0 -93
- package/dist/primitives.js +0 -2
- package/dist/primitives.js.map +0 -1
- package/dist/primitives.mjs +0 -2
- package/dist/primitives.mjs.map +0 -1
- package/dist/renderer-DSLb-FGg.d.cts +0 -135
- package/dist/renderer-DSLb-FGg.d.ts +0 -135
- package/dist/server.d.cts +0 -3
- package/dist/server.d.ts +0 -3
- package/dist/server.js +0 -2
- package/dist/server.js.map +0 -1
- package/dist/server.mjs +0 -2
- package/dist/server.mjs.map +0 -1
- package/dist/state-DitsMyev.d.cts +0 -96
- package/dist/state-DitsMyev.d.ts +0 -96
- package/dist/state-RYKSC35A.mjs +0 -2
- package/dist/state-RYKSC35A.mjs.map +0 -1
- package/dist/state-XUXPMCFJ.js +0 -2
- package/dist/state-XUXPMCFJ.js.map +0 -1
- package/dist/sync-Z4QqUDjF.d.cts +0 -25
- package/dist/sync-Z4QqUDjF.d.ts +0 -25
- package/dist/test-exports.d.cts +0 -68
- package/dist/test-exports.d.ts +0 -68
- package/dist/test-exports.js +0 -2
- package/dist/test-exports.js.map +0 -1
- package/dist/test-exports.mjs +0 -2
- package/dist/test-exports.mjs.map +0 -1
package/dist/primitives/ui.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {k}from'../chunk-BBNYMXE7.mjs';import'../chunk-FDMJHFN7.mjs';import {a}from'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';import {c as c$1,d}from'../chunk-HB5VPQTB.mjs';import {c,a as a$1,b}from'../chunk-ECYYIQEX.mjs';function j(u){let{type:y="button",variant:a$2="primary",size:v="md",disabled:r=false,loading:b$1=false,fullWidth:G=false,children:E,leftIcon:k$1,rightIcon:D,loadingText:C="Loading...",className:N="",style:J,id:w,role:I,ariaLabel:V,ariaDescribedby:A,ariaExpanded:F,ariaPressed:K,ariaControls:z,onPress:H,onPressStart:s,onPressEnd:l,onFocus:m,onBlur:L,onKeyDown:M}=u,g=["button",`button-${a$2}`,`button-${v}`];G&&g.push("button-full-width"),N&&g.push(N);let o={type:y,class:g.join(" "),style:J};w&&(o.id=w),I&&(o.role=I),V&&(o["aria-label"]=V),A&&(o["aria-describedby"]=A),F!==void 0&&(o["aria-expanded"]=F),K!==void 0&&(o["aria-pressed"]=K),z&&(o["aria-controls"]=z),o.ref=e=>{if(!e)return;let B=typeof r=="boolean"?k(r)[0]:r,P=typeof b$1=="boolean"?k(b$1)[0]:b$1,d$1=e.querySelector(".button-content"),c=e.querySelector(".button-spinner"),p=e.querySelector(".button-text");if(c$1(()=>{let n=typeof B=="function"?B():B;e.disabled=n,n?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled");}),c$1(()=>{(typeof P=="function"?P():P)?(c&&(c.style.display="inline-block"),d$1&&(d$1.style.visibility="hidden"),C&&p&&(p.textContent=C),e.disabled=true,e.setAttribute("aria-busy","true")):(c&&(c.style.display="none"),d$1&&(d$1.style.visibility="visible"),typeof E=="string"&&p&&(p.textContent=E),e.removeAttribute("aria-busy"));}),H){let n=false,_=t=>{e.disabled||(n=true,e.classList.add("button-pressed"),s&&s(t));},U=t=>{n&&(n=false,e.classList.remove("button-pressed"),l&&l(t));},S=async t=>{if(e.disabled){t.preventDefault();return}try{await H(t);}catch(X){b(a$1.BUTTON_HANDLER_FAILED,void 0,X);}},W=t=>{e.disabled||((t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n=true,e.classList.add("button-pressed"),s&&s(t)),M&&M(t));},q=t=>{e.disabled||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n=false,e.classList.remove("button-pressed"),l&&l(t),S(t));},R=()=>{n=false,e.classList.remove("button-pressed");};e.addEventListener("pointerdown",_),e.addEventListener("pointerup",U),e.addEventListener("click",S),e.addEventListener("keydown",W),e.addEventListener("keyup",q),e.addEventListener("pointercancel",R),d(()=>{e.removeEventListener("pointerdown",_),e.removeEventListener("pointerup",U),e.removeEventListener("click",S),e.removeEventListener("keydown",W),e.removeEventListener("keyup",q),e.removeEventListener("pointercancel",R);});}m&&(e.addEventListener("focus",m),d(()=>e.removeEventListener("focus",m))),L&&(e.addEventListener("blur",L),d(()=>e.removeEventListener("blur",L)));};let Q=[a("span",{class:"button-spinner","aria-hidden":"true",style:{display:"none"}}),a("span",{class:"button-content"},[k$1&&a("span",{class:"button-icon button-icon-left"},k$1),a("span",{class:"button-text"},E),D&&a("span",{class:"button-icon button-icon-right"},D)].filter(Boolean))];return a("button",o,Q)}function Y(u){let{icon:y,ariaLabel:a,className:v,...r}=u;return a||c(a$1.BUTTON_MISSING_ARIA_LABEL),j({...r,children:y,ariaLabel:a,className:`icon-button ${v||""}`})}export{j as Button,Y as IconButton};//# sourceMappingURL=ui.mjs.map
|
|
2
|
-
//# sourceMappingURL=ui.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/ui/Button.ts"],"names":["Button","props","type","variant","size","disabled","loading","fullWidth","children","leftIcon","rightIcon","loadingText","className","style","id","role","ariaLabel","ariaDescribedby","ariaExpanded","ariaPressed","ariaControls","onPress","onPressStart","onPressEnd","onFocus","onBlur","onKeyDown","classes","buttonProps","button","disabledSignal","state","loadingSignal","contentWrapper","loadingSpinner","textContent","effect","val","isPressing","handlePointerDown","e","handlePointerUp","handleClick","error","logError","ErrorCodes","handleKeyDown","handleKeyUp","handlePointerCancel","onCleanup","buttonChildren","f","IconButton","icon","logWarning"],"mappings":"wOAwFO,SAASA,CAAAA,CAAOC,CAAAA,CAA2B,CAChD,GAAM,CACJ,IAAA,CAAAC,CAAAA,CAAO,QAAA,CACP,OAAA,CAAAC,GAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,GAAAA,CAAU,KAAA,CACV,SAAA,CAAAC,CAAAA,CAAY,MACZ,QAAA,CAAAC,CAAAA,CACA,QAAA,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AAW,yBAAyB,CAAA,CAG1C7C,CAAAA,CAAO,CACZ,GAAG4B,EACH,QAAA,CAAUyB,CAAAA,CACV,SAAA,CAAArC,CAAAA,CACA,UAAW,CAAA,YAAA,EAAeJ,CAAAA,EAAa,EAAE,CAAA,CAC3C,CAAC,CACH","file":"ui.mjs","sourcesContent":["/**\n * Button Component - Accessible button with unified touch/click handler\n *\n * Provides onPress handler that works consistently across mouse, touch, and keyboard\n * Includes full ARIA support and style props\n */\n\nimport { state, type StateValue } from '../../core/state'\nimport { onCleanup } from '../../core/effect'\nimport { effect } from '../../core/effect'\nimport { ErrorCodes, logError, logWarning } from '../../core/errors'\nimport { f } from '../../renderers/dom/f'\nimport type { FNode } from '../../core/renderer'\n\n/**\n * Button variants\n */\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'danger'\n\n/**\n * Button sizes\n */\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\n/**\n * Button component props\n */\nexport interface ButtonProps {\n type?: ButtonType\n variant?: ButtonVariant\n size?: ButtonSize\n disabled?: StateValue<boolean> | boolean\n loading?: StateValue<boolean> | boolean\n fullWidth?: boolean\n\n // Content\n children?: any\n leftIcon?: any\n rightIcon?: any\n loadingText?: string\n\n // Styling\n className?: string\n style?: Partial<CSSStyleDeclaration>\n\n // Accessibility\n id?: string\n role?: string\n ariaLabel?: string\n ariaDescribedby?: string\n ariaExpanded?: boolean\n ariaPressed?: boolean\n ariaControls?: string\n\n // Event handlers\n onPress?: (event: Event) => void | Promise<void>\n onPressStart?: (event: PointerEvent) => void\n onPressEnd?: (event: PointerEvent) => void\n onFocus?: (event: FocusEvent) => void\n onBlur?: (event: FocusEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n}\n\n/**\n * Button component - Accessible button with unified touch/click handler\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" onPress={() => console.log('clicked')}>\n * Click me\n * </Button>\n *\n * const loading = signal(false)\n * <Button loading={loading} loadingText=\"Saving...\">\n * Save\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): FNode {\n const {\n type = 'button',\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n fullWidth = false,\n children,\n leftIcon,\n rightIcon,\n loadingText = 'Loading...',\n className = '',\n style,\n id,\n role,\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaPressed,\n ariaControls,\n onPress,\n onPressStart,\n onPressEnd,\n onFocus,\n onBlur,\n onKeyDown,\n } = props\n\n // Build class names\n const classes = ['button', `button-${variant}`, `button-${size}`]\n if (fullWidth) classes.push('button-full-width')\n if (className) classes.push(className)\n\n // Build props for the button element\n const buttonProps: Record<string, any> = {\n type,\n class: classes.join(' '),\n style,\n }\n\n if (id) buttonProps.id = id\n if (role) buttonProps.role = role\n if (ariaLabel) buttonProps['aria-label'] = ariaLabel\n if (ariaDescribedby) buttonProps['aria-describedby'] = ariaDescribedby\n if (ariaExpanded !== undefined) buttonProps['aria-expanded'] = ariaExpanded\n if (ariaPressed !== undefined) buttonProps['aria-pressed'] = ariaPressed\n if (ariaControls) buttonProps['aria-controls'] = ariaControls\n\n // Add ref callback to set up reactive behavior\n buttonProps.ref = (button: HTMLButtonElement | null) => {\n if (!button) return\n\n // Convert disabled/loading to signals if needed\n const disabledSignal: StateValue<boolean> | boolean =\n typeof disabled === 'boolean' ? state(disabled)[0] : disabled\n const loadingSignal: StateValue<boolean> | boolean =\n typeof loading === 'boolean' ? state(loading)[0] : loading\n\n // Find content elements after mount\n const contentWrapper = button.querySelector('.button-content') as HTMLElement\n const loadingSpinner = button.querySelector('.button-spinner') as HTMLElement\n const textContent = button.querySelector('.button-text') as HTMLElement\n\n // Handle disabled state\n effect(() => {\n const val = typeof disabledSignal === 'function' ? (disabledSignal as StateValue<boolean>)() : disabledSignal\n button.disabled = val\n if (val) {\n button.setAttribute('aria-disabled', 'true')\n } else {\n button.removeAttribute('aria-disabled')\n }\n })\n\n // Handle loading state\n effect(() => {\n const isLoading = typeof loadingSignal === 'function' ? (loadingSignal as StateValue<boolean>)() : loadingSignal\n\n if (isLoading) {\n // Show spinner\n if (loadingSpinner) loadingSpinner.style.display = 'inline-block'\n if (contentWrapper) contentWrapper.style.visibility = 'hidden'\n\n // Update text for screen readers\n if (loadingText && textContent) {\n textContent.textContent = loadingText\n }\n\n // Disable button during loading\n button.disabled = true\n button.setAttribute('aria-busy', 'true')\n } else {\n // Hide spinner\n if (loadingSpinner) loadingSpinner.style.display = 'none'\n if (contentWrapper) contentWrapper.style.visibility = 'visible'\n\n // Restore original text\n if (typeof children === 'string' && textContent) {\n textContent.textContent = children\n }\n\n button.removeAttribute('aria-busy')\n }\n })\n\n // Unified press handler (works for mouse, touch, and keyboard)\n if (onPress) {\n let isPressing = false\n\n // Pointer down (mouse/touch start)\n const handlePointerDown = (e: PointerEvent) => {\n if (button.disabled) return\n\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n onPressStart(e)\n }\n }\n\n // Pointer up (mouse/touch end)\n const handlePointerUp = (e: PointerEvent) => {\n if (!isPressing) return\n\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n onPressEnd(e)\n }\n }\n\n // Click (fires after pointer up)\n const handleClick = async (e: Event) => {\n if (button.disabled) {\n e.preventDefault()\n return\n }\n\n try {\n await onPress(e)\n } catch (error) {\n logError(ErrorCodes.BUTTON_HANDLER_FAILED, undefined, error)\n }\n }\n\n // Keyboard (Enter/Space)\n const handleKeyDown = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n // Enter or Space triggers press\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressStart(e as any)\n }\n }\n\n // Custom keydown handler\n if (onKeyDown) {\n onKeyDown(e)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressEnd(e as any)\n }\n\n // Trigger press\n handleClick(e)\n }\n }\n\n // Pointer cancel (touch interrupted)\n const handlePointerCancel = () => {\n isPressing = false\n button.classList.remove('button-pressed')\n }\n\n button.addEventListener('pointerdown', handlePointerDown)\n button.addEventListener('pointerup', handlePointerUp)\n button.addEventListener('click', handleClick)\n button.addEventListener('keydown', handleKeyDown)\n button.addEventListener('keyup', handleKeyUp)\n button.addEventListener('pointercancel', handlePointerCancel)\n\n onCleanup(() => {\n button.removeEventListener('pointerdown', handlePointerDown)\n button.removeEventListener('pointerup', handlePointerUp)\n button.removeEventListener('click', handleClick)\n button.removeEventListener('keydown', handleKeyDown)\n button.removeEventListener('keyup', handleKeyUp)\n button.removeEventListener('pointercancel', handlePointerCancel)\n })\n }\n\n // Focus/blur handlers\n if (onFocus) {\n button.addEventListener('focus', onFocus)\n onCleanup(() => button.removeEventListener('focus', onFocus))\n }\n\n if (onBlur) {\n button.addEventListener('blur', onBlur)\n onCleanup(() => button.removeEventListener('blur', onBlur))\n }\n }\n\n // Build button content structure\n const buttonChildren = [\n // Loading spinner\n f('span', {\n class: 'button-spinner',\n 'aria-hidden': 'true',\n style: { display: 'none' },\n }),\n // Content wrapper with icons and text\n f(\n 'span',\n { class: 'button-content' },\n [\n leftIcon && f('span', { class: 'button-icon button-icon-left' }, leftIcon),\n f('span', { class: 'button-text' }, children),\n rightIcon &&\n f('span', { class: 'button-icon button-icon-right' }, rightIcon),\n ].filter(Boolean)\n ),\n ]\n\n return f('button', buttonProps, buttonChildren)\n}\n\n/**\n * IconButton component - Button with only an icon\n *\n * @example\n * ```tsx\n * <IconButton icon={<i class=\"icon-close\" />} ariaLabel=\"Close\" onPress={handleClose} />\n * ```\n */\nexport function IconButton(props: ButtonProps & { icon: any }): FNode {\n const { icon, ariaLabel, className, ...buttonProps } = props\n\n if (!ariaLabel) {\n logWarning(ErrorCodes.BUTTON_MISSING_ARIA_LABEL)\n }\n\n return Button({\n ...buttonProps,\n children: icon,\n ariaLabel,\n className: `icon-button ${className || ''}`,\n })\n}\n"]}
|
package/dist/primitives.d.cts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export { e as effect } from './core-CxHP8991.cjs';
|
|
2
|
-
export { r as root } from './owner-QS9tPwPr.cjs';
|
|
3
|
-
export { s as state } from './state-DitsMyev.cjs';
|
|
4
|
-
export { CommonStyle as BaseStyleProps, Column, ColumnProps, CommonStyle, Grid, GridProps, Row, RowProps, Spacer, SpacerProps, Stack, StackProps } from './primitives/layout.cjs';
|
|
5
|
-
import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-CVAKQ5wZ.cjs';
|
|
6
|
-
export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-CVAKQ5wZ.cjs';
|
|
7
|
-
import './renderer-DSLb-FGg.cjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Text - Universal text display component
|
|
11
|
-
*
|
|
12
|
-
* Maps to:
|
|
13
|
-
* - Web: <span>
|
|
14
|
-
* - React Native: <Text>
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Text style={{ color: 'blue', fontSize: 16 }}>
|
|
19
|
-
* Hello World
|
|
20
|
-
* </Text>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
declare function Text(props: TextProps): FNode;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Image - Universal image component
|
|
28
|
-
*
|
|
29
|
-
* Maps to:
|
|
30
|
-
* - Web: <img>
|
|
31
|
-
* - React Native: <Image>
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <Image
|
|
36
|
-
* src="/logo.png"
|
|
37
|
-
* alt="Logo"
|
|
38
|
-
* width={100}
|
|
39
|
-
* height={100}
|
|
40
|
-
* />
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
declare function Image(props: ImageProps): FNode;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Pressable - Universal touchable/clickable component
|
|
48
|
-
*
|
|
49
|
-
* Maps to:
|
|
50
|
-
* - Web: <button>
|
|
51
|
-
* - React Native: <Pressable>
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <Pressable
|
|
56
|
-
* onPress={() => console.log('pressed')}
|
|
57
|
-
* style={{ padding: 10 }}
|
|
58
|
-
* >
|
|
59
|
-
* <Text>Click Me</Text>
|
|
60
|
-
* </Pressable>
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
declare function Pressable(props: PressableProps): FNode;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* ScrollView - Universal scrollable container
|
|
68
|
-
*
|
|
69
|
-
* Maps to:
|
|
70
|
-
* - Web: <div style="overflow: scroll">
|
|
71
|
-
* - React Native: <ScrollView>
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```tsx
|
|
75
|
-
* <ScrollView style={{ height: 300 }}>
|
|
76
|
-
* <Column>...</Column>
|
|
77
|
-
* <Column>...</Column>
|
|
78
|
-
* </ScrollView>
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
declare function ScrollView(props: ScrollViewProps): FNode;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Primitive utilities
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Normalize CommonStyle to CSS properties
|
|
90
|
-
*/
|
|
91
|
-
declare function normalizeStyle(style?: CommonStyle | TextStyle): Record<string, any>;
|
|
92
|
-
|
|
93
|
-
export { Image, ImageProps, Pressable, PressableProps, ScrollView, ScrollViewProps, Text, TextProps, TextStyle, normalizeStyle };
|
package/dist/primitives.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export { e as effect } from './core-D0ggvjX3.js';
|
|
2
|
-
export { r as root } from './owner-QS9tPwPr.js';
|
|
3
|
-
export { s as state } from './state-DitsMyev.js';
|
|
4
|
-
export { CommonStyle as BaseStyleProps, Column, ColumnProps, CommonStyle, Grid, GridProps, Row, RowProps, Spacer, SpacerProps, Stack, StackProps } from './primitives/layout.js';
|
|
5
|
-
import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-Dlh1L1Ar.js';
|
|
6
|
-
export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-Dlh1L1Ar.js';
|
|
7
|
-
import './renderer-DSLb-FGg.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Text - Universal text display component
|
|
11
|
-
*
|
|
12
|
-
* Maps to:
|
|
13
|
-
* - Web: <span>
|
|
14
|
-
* - React Native: <Text>
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Text style={{ color: 'blue', fontSize: 16 }}>
|
|
19
|
-
* Hello World
|
|
20
|
-
* </Text>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
declare function Text(props: TextProps): FNode;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Image - Universal image component
|
|
28
|
-
*
|
|
29
|
-
* Maps to:
|
|
30
|
-
* - Web: <img>
|
|
31
|
-
* - React Native: <Image>
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <Image
|
|
36
|
-
* src="/logo.png"
|
|
37
|
-
* alt="Logo"
|
|
38
|
-
* width={100}
|
|
39
|
-
* height={100}
|
|
40
|
-
* />
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
declare function Image(props: ImageProps): FNode;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Pressable - Universal touchable/clickable component
|
|
48
|
-
*
|
|
49
|
-
* Maps to:
|
|
50
|
-
* - Web: <button>
|
|
51
|
-
* - React Native: <Pressable>
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <Pressable
|
|
56
|
-
* onPress={() => console.log('pressed')}
|
|
57
|
-
* style={{ padding: 10 }}
|
|
58
|
-
* >
|
|
59
|
-
* <Text>Click Me</Text>
|
|
60
|
-
* </Pressable>
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
declare function Pressable(props: PressableProps): FNode;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* ScrollView - Universal scrollable container
|
|
68
|
-
*
|
|
69
|
-
* Maps to:
|
|
70
|
-
* - Web: <div style="overflow: scroll">
|
|
71
|
-
* - React Native: <ScrollView>
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```tsx
|
|
75
|
-
* <ScrollView style={{ height: 300 }}>
|
|
76
|
-
* <Column>...</Column>
|
|
77
|
-
* <Column>...</Column>
|
|
78
|
-
* </ScrollView>
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
declare function ScrollView(props: ScrollViewProps): FNode;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Primitive utilities
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Normalize CommonStyle to CSS properties
|
|
90
|
-
*/
|
|
91
|
-
declare function normalizeStyle(style?: CommonStyle | TextStyle): Record<string, any>;
|
|
92
|
-
|
|
93
|
-
export { Image, ImageProps, Pressable, PressableProps, ScrollView, ScrollViewProps, Text, TextProps, TextStyle, normalizeStyle };
|
package/dist/primitives.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkYDZ37ZZ4_js=require('./chunk-YDZ37ZZ4.js'),chunkQPCIDSMM_js=require('./chunk-QPCIDSMM.js'),chunkXJHWMHKF_js=require('./chunk-XJHWMHKF.js');require('./chunk-YPVRQKMW.js'),require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js');var chunkWWEWRI6S_js=require('./chunk-WWEWRI6S.js'),chunkGYDP6MFV_js=require('./chunk-GYDP6MFV.js');function A(s){let{children:r,style:a,onPress:e,class:p,...o}=s;return {type:"span",props:{...o,class:p,style:chunkQPCIDSMM_js.a(a),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(s){let{src:r,alt:a,width:e,height:p,style:o,onLoad:n,onError:i,...l}=s,m={...o,width:e||o?.width,height:p||o?.height};return {type:"img",props:{...l,src:r,alt:a||"",style:chunkQPCIDSMM_js.a(m),onload:n,onerror:i},children:[]}}function T(s){let{children:r,onPress:a,onPressIn:e,onPressOut:p,disabled:o,style:n,activeOpacity:i=.7,...l}=s,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:chunkQPCIDSMM_js.a(m),onclick:o?void 0:a,onmousedown:e,onmouseup:p,ontouchstart:e,ontouchend:p},children:Array.isArray(r)?r:r?[r]:[]}}function F(s){let{children:r,style:a,horizontal:e=false,showScrollbarX:p=true,showScrollbarY:o=true,...n}=s,i={...a,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!p||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:chunkQPCIDSMM_js.a(i)},children:Array.isArray(r)?r:r?[r]:[]}}Object.defineProperty(exports,"Column",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.h}});Object.defineProperty(exports,"Grid",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.j}});Object.defineProperty(exports,"Row",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.g}});Object.defineProperty(exports,"Spacer",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.i}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.k}});Object.defineProperty(exports,"Canvas",{enumerable:true,get:function(){return chunkQPCIDSMM_js.d}});Object.defineProperty(exports,"DrawArc",{enumerable:true,get:function(){return chunkQPCIDSMM_js.g}});Object.defineProperty(exports,"DrawCircle",{enumerable:true,get:function(){return chunkQPCIDSMM_js.f}});Object.defineProperty(exports,"DrawLine",{enumerable:true,get:function(){return chunkQPCIDSMM_js.h}});Object.defineProperty(exports,"DrawPath",{enumerable:true,get:function(){return chunkQPCIDSMM_js.i}});Object.defineProperty(exports,"DrawRect",{enumerable:true,get:function(){return chunkQPCIDSMM_js.e}});Object.defineProperty(exports,"DrawText",{enumerable:true,get:function(){return chunkQPCIDSMM_js.j}});Object.defineProperty(exports,"normalizeStyle",{enumerable:true,get:function(){return chunkQPCIDSMM_js.a}});Object.defineProperty(exports,"state",{enumerable:true,get:function(){return chunkXJHWMHKF_js.k}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkWWEWRI6S_js.c}});Object.defineProperty(exports,"root",{enumerable:true,get:function(){return chunkGYDP6MFV_js.i}});exports.Image=N;exports.Pressable=T;exports.ScrollView=F;exports.Text=A;//# sourceMappingURL=primitives.js.map
|
|
2
|
-
//# sourceMappingURL=primitives.js.map
|
package/dist/primitives.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"kWAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAOC,EAAW,GAAGC,CAAK,CAAA,CAAIL,CAAAA,CAEhE,OAAO,CACL,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,CACL,GAAGK,CAAAA,CACH,KAAA,CAAOD,CAAAA,CACP,KAAA,CAAOE,kBAAAA,CAAeJ,CAAK,CAAA,CAC3B,OAAA,CAASC,CACX,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQF,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF,CCVO,SAASM,CAAAA,CAAMP,CAAAA,CAA0B,CAC9C,GAAM,CAAE,GAAA,CAAAQ,EAAK,GAAA,CAAAC,CAAAA,CAAK,KAAA,CAAAC,CAAAA,CAAO,MAAA,CAAAC,CAAAA,CAAQ,KAAA,CAAAT,CAAAA,CAAO,OAAAU,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,GAAGR,CAAK,CAAA,CAAIL,CAAAA,CAE/Dc,CAAAA,CAAa,CACjB,GAAGZ,CAAAA,CACH,KAAA,CAAOQ,CAAAA,EAASR,CAAAA,EAAO,KAAA,CACvB,MAAA,CAAQS,GAAUT,CAAAA,EAAO,MAC3B,CAAA,CAEA,OAAO,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGG,CAAAA,CACH,GAAA,CAAAG,CAAAA,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,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,GAAGnB,CACL,EAAIL,CAAAA,CAEEyB,CAAAA,CAAuC,CAC3C,GAAGvB,CAAAA,CACH,SAAA,CAAWoB,CAAAA,CAAa,MAAA,CAAS,QAAA,CACjC,SAAA,CAAWA,CAAAA,CAAa,QAAA,CAAW,MAAA,CACnC,OAAA,CAAS,MAAA,CACT,aAAA,CAAeA,EAAa,KAAA,CAAQ,QACtC,CAAA,CAGA,OAAA,CAAI,CAACC,CAAAA,EAAkB,CAACC,CAAAA,IACtBC,CAAAA,CAAY,cAAA,CAAiB,MAAA,CAAA,CAGxB,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,KAAA,CAAOC,kBAAAA,CAAemB,CAAmD,CAC3E,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,QAAQxB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF","file":"primitives.js","sourcesContent":["/**\n * Text - Universal text display component\n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
|
package/dist/primitives.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{h as Column,j as Grid,g as Row,i as Spacer,k as Stack}from'./chunk-BYHIHYRR.mjs';import {a}from'./chunk-QZIX4FXS.mjs';export{d as Canvas,g as DrawArc,f as DrawCircle,h as DrawLine,i as DrawPath,e as DrawRect,j as DrawText,a as normalizeStyle}from'./chunk-QZIX4FXS.mjs';export{k as state}from'./chunk-BBNYMXE7.mjs';import'./chunk-FDMJHFN7.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';export{c as effect}from'./chunk-HB5VPQTB.mjs';export{i as root}from'./chunk-ECYYIQEX.mjs';function A(s){let{children:r,style:a$1,onPress:e,class:p,...o}=s;return {type:"span",props:{...o,class:p,style:a(a$1),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(s){let{src:r,alt:a$1,width:e,height:p,style:o,onLoad:n,onError:i,...l}=s,m={...o,width:e||o?.width,height:p||o?.height};return {type:"img",props:{...l,src:r,alt:a$1||"",style:a(m),onload:n,onerror:i},children:[]}}function T(s){let{children:r,onPress:a$1,onPressIn:e,onPressOut:p,disabled:o,style:n,activeOpacity:i=.7,...l}=s,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:a(m),onclick:o?void 0:a$1,onmousedown:e,onmouseup:p,ontouchstart:e,ontouchend:p},children:Array.isArray(r)?r:r?[r]:[]}}function F(s){let{children:r,style:a$1,horizontal:e=false,showScrollbarX:p=true,showScrollbarY:o=true,...n}=s,i={...a$1,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!p||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:a(i)},children:Array.isArray(r)?r:r?[r]:[]}}export{N as Image,T as Pressable,F as ScrollView,A as Text};//# sourceMappingURL=primitives.mjs.map
|
|
2
|
-
//# sourceMappingURL=primitives.mjs.map
|
package/dist/primitives.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"kfAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,GAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAOC,EAAW,GAAGC,CAAK,CAAA,CAAIL,CAAAA,CAEhE,OAAO,CACL,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,CACL,GAAGK,CAAAA,CACH,KAAA,CAAOD,CAAAA,CACP,KAAA,CAAOE,CAAAA,CAAeJ,GAAK,CAAA,CAC3B,OAAA,CAASC,CACX,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQF,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF,CCVO,SAASM,CAA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G,CAAAA,CACH,QAAA,CAAAa,CAAAA,CACA,MAAOZ,CAAAA,CAAec,CAAW,CAAA,CACjC,OAAA,CAASF,CAAAA,CAAW,MAAA,CAAYf,GAAAA,CAChC,WAAA,CAAaa,CAAAA,CACb,SAAA,CAAWC,CAAAA,CACX,YAAA,CAAcD,CAAAA,CACd,UAAA,CAAYC,CACd,CAAA,CACA,SAAU,KAAA,CAAM,OAAA,CAAQhB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,EAAI,EACzE,CACF,CCrCO,SAASoB,CAAAA,CAAWrB,CAAAA,CAA+B,CACxD,GAAM,CACJ,QAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,UAAA,CAAAoB,CAAAA,CAAa,KAAA,CACb,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,GAAGnB,CACL,EAAIL,CAAAA,CAEEyB,CAAAA,CAAuC,CAC3C,GAAGvB,GAAAA,CACH,SAAA,CAAWoB,CAAAA,CAAa,MAAA,CAAS,QAAA,CACjC,SAAA,CAAWA,CAAAA,CAAa,QAAA,CAAW,MAAA,CACnC,OAAA,CAAS,MAAA,CACT,aAAA,CAAeA,EAAa,KAAA,CAAQ,QACtC,CAAA,CAGA,OAAA,CAAI,CAACC,CAAAA,EAAkB,CAACC,CAAAA,IACtBC,CAAAA,CAAY,cAAA,CAAiB,MAAA,CAAA,CAGxB,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,KAAA,CAAOC,CAAAA,CAAemB,CAAmD,CAC3E,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,QAAQxB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF","file":"primitives.mjs","sourcesContent":["/**\n * Text - Universal text display component\n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core Renderer Interface
|
|
3
|
-
*
|
|
4
|
-
* This interface defines the contract that all platform-specific renderers must implement.
|
|
5
|
-
* It provides a unified API for creating, updating, and managing nodes across different
|
|
6
|
-
* rendering targets (DOM, Canvas, React Native, WebGL, etc.).
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Base node type - platform-specific implementations will extend this
|
|
10
|
-
* Using any intentionally for cross-platform flexibility (DOM Node, Canvas, etc.)
|
|
11
|
-
*/
|
|
12
|
-
type RenderNode = any;
|
|
13
|
-
/**
|
|
14
|
-
* Event handler function type
|
|
15
|
-
*/
|
|
16
|
-
type EventHandler = (event: Event) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Core renderer interface that all platform renderers must implement
|
|
19
|
-
*/
|
|
20
|
-
interface Renderer {
|
|
21
|
-
/**
|
|
22
|
-
* Create a new platform-specific node
|
|
23
|
-
* @param type - The type of node to create (e.g., 'div', 'Row', 'Text')
|
|
24
|
-
* @param props - Properties to apply to the node
|
|
25
|
-
* @returns The created node
|
|
26
|
-
*/
|
|
27
|
-
createNode(type: string, props: Record<string, unknown>): RenderNode;
|
|
28
|
-
/**
|
|
29
|
-
* Update the properties of an existing node
|
|
30
|
-
* @param node - The node to update
|
|
31
|
-
* @param oldProps - Previous properties (for diffing)
|
|
32
|
-
* @param newProps - New properties to apply
|
|
33
|
-
*/
|
|
34
|
-
updateNode(node: RenderNode, oldProps: Record<string, unknown>, newProps: Record<string, unknown>): void;
|
|
35
|
-
/**
|
|
36
|
-
* Append a child node to a parent node
|
|
37
|
-
* @param parent - The parent node
|
|
38
|
-
* @param child - The child node to append
|
|
39
|
-
*/
|
|
40
|
-
appendChild(parent: RenderNode, child: RenderNode): void;
|
|
41
|
-
/**
|
|
42
|
-
* Insert a child node before a reference node
|
|
43
|
-
* @param parent - The parent node
|
|
44
|
-
* @param child - The child node to insert
|
|
45
|
-
* @param beforeChild - The reference node to insert before
|
|
46
|
-
*/
|
|
47
|
-
insertBefore(parent: RenderNode, child: RenderNode, beforeChild: RenderNode | null): void;
|
|
48
|
-
/**
|
|
49
|
-
* Remove a child node from a parent node
|
|
50
|
-
* @param parent - The parent node
|
|
51
|
-
* @param child - The child node to remove
|
|
52
|
-
*/
|
|
53
|
-
removeChild(parent: RenderNode, child: RenderNode): void;
|
|
54
|
-
/**
|
|
55
|
-
* Create a text node
|
|
56
|
-
* @param text - The text content
|
|
57
|
-
* @returns The created text node
|
|
58
|
-
*/
|
|
59
|
-
createTextNode(text: string): RenderNode;
|
|
60
|
-
/**
|
|
61
|
-
* Update the text content of a text node
|
|
62
|
-
* @param node - The text node to update
|
|
63
|
-
* @param text - The new text content
|
|
64
|
-
*/
|
|
65
|
-
updateTextNode(node: RenderNode, text: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Add an event listener to a node
|
|
68
|
-
* @param node - The node to attach the listener to
|
|
69
|
-
* @param event - The event name (e.g., 'click', 'press')
|
|
70
|
-
* @param handler - The event handler function
|
|
71
|
-
*/
|
|
72
|
-
addEventListener(node: RenderNode, event: string, handler: EventHandler): void;
|
|
73
|
-
/**
|
|
74
|
-
* Remove an event listener from a node
|
|
75
|
-
* @param node - The node to remove the listener from
|
|
76
|
-
* @param event - The event name
|
|
77
|
-
* @param handler - The event handler function
|
|
78
|
-
*/
|
|
79
|
-
removeEventListener(node: RenderNode, event: string, handler: EventHandler): void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Platform-agnostic props that should be supported across all renderers
|
|
83
|
-
*/
|
|
84
|
-
interface CommonProps {
|
|
85
|
-
width?: number | string;
|
|
86
|
-
height?: number | string;
|
|
87
|
-
padding?: number;
|
|
88
|
-
paddingTop?: number;
|
|
89
|
-
paddingRight?: number;
|
|
90
|
-
paddingBottom?: number;
|
|
91
|
-
paddingLeft?: number;
|
|
92
|
-
margin?: number;
|
|
93
|
-
marginTop?: number;
|
|
94
|
-
marginRight?: number;
|
|
95
|
-
marginBottom?: number;
|
|
96
|
-
marginLeft?: number;
|
|
97
|
-
flexDirection?: 'row' | 'column';
|
|
98
|
-
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
99
|
-
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
100
|
-
gap?: number;
|
|
101
|
-
flex?: number;
|
|
102
|
-
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
103
|
-
bg?: string;
|
|
104
|
-
color?: string;
|
|
105
|
-
borderRadius?: number;
|
|
106
|
-
borderWidth?: number;
|
|
107
|
-
borderColor?: string;
|
|
108
|
-
opacity?: number;
|
|
109
|
-
fontSize?: number;
|
|
110
|
-
fontWeight?: number | string;
|
|
111
|
-
fontFamily?: string;
|
|
112
|
-
lineHeight?: number;
|
|
113
|
-
textAlign?: 'left' | 'center' | 'right';
|
|
114
|
-
onPress?: EventHandler;
|
|
115
|
-
onHover?: EventHandler;
|
|
116
|
-
onChange?: EventHandler;
|
|
117
|
-
onFocus?: EventHandler;
|
|
118
|
-
onBlur?: EventHandler;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Child types that can be rendered
|
|
122
|
-
*/
|
|
123
|
-
type FNodeChild = FNode | string | number | boolean | null | undefined | FNodeChild[];
|
|
124
|
-
/**
|
|
125
|
-
* Flexium Node - lightweight element descriptor for JSX
|
|
126
|
-
* (Not a Virtual DOM - just a simple descriptor that gets immediately converted to real DOM)
|
|
127
|
-
*/
|
|
128
|
-
interface FNode {
|
|
129
|
-
type: string | Function;
|
|
130
|
-
props: Record<string, unknown>;
|
|
131
|
-
children: FNodeChild[];
|
|
132
|
-
key?: string | number;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export type { CommonProps as C, EventHandler as E, FNode as F, Renderer as R, FNodeChild as a };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core Renderer Interface
|
|
3
|
-
*
|
|
4
|
-
* This interface defines the contract that all platform-specific renderers must implement.
|
|
5
|
-
* It provides a unified API for creating, updating, and managing nodes across different
|
|
6
|
-
* rendering targets (DOM, Canvas, React Native, WebGL, etc.).
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Base node type - platform-specific implementations will extend this
|
|
10
|
-
* Using any intentionally for cross-platform flexibility (DOM Node, Canvas, etc.)
|
|
11
|
-
*/
|
|
12
|
-
type RenderNode = any;
|
|
13
|
-
/**
|
|
14
|
-
* Event handler function type
|
|
15
|
-
*/
|
|
16
|
-
type EventHandler = (event: Event) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Core renderer interface that all platform renderers must implement
|
|
19
|
-
*/
|
|
20
|
-
interface Renderer {
|
|
21
|
-
/**
|
|
22
|
-
* Create a new platform-specific node
|
|
23
|
-
* @param type - The type of node to create (e.g., 'div', 'Row', 'Text')
|
|
24
|
-
* @param props - Properties to apply to the node
|
|
25
|
-
* @returns The created node
|
|
26
|
-
*/
|
|
27
|
-
createNode(type: string, props: Record<string, unknown>): RenderNode;
|
|
28
|
-
/**
|
|
29
|
-
* Update the properties of an existing node
|
|
30
|
-
* @param node - The node to update
|
|
31
|
-
* @param oldProps - Previous properties (for diffing)
|
|
32
|
-
* @param newProps - New properties to apply
|
|
33
|
-
*/
|
|
34
|
-
updateNode(node: RenderNode, oldProps: Record<string, unknown>, newProps: Record<string, unknown>): void;
|
|
35
|
-
/**
|
|
36
|
-
* Append a child node to a parent node
|
|
37
|
-
* @param parent - The parent node
|
|
38
|
-
* @param child - The child node to append
|
|
39
|
-
*/
|
|
40
|
-
appendChild(parent: RenderNode, child: RenderNode): void;
|
|
41
|
-
/**
|
|
42
|
-
* Insert a child node before a reference node
|
|
43
|
-
* @param parent - The parent node
|
|
44
|
-
* @param child - The child node to insert
|
|
45
|
-
* @param beforeChild - The reference node to insert before
|
|
46
|
-
*/
|
|
47
|
-
insertBefore(parent: RenderNode, child: RenderNode, beforeChild: RenderNode | null): void;
|
|
48
|
-
/**
|
|
49
|
-
* Remove a child node from a parent node
|
|
50
|
-
* @param parent - The parent node
|
|
51
|
-
* @param child - The child node to remove
|
|
52
|
-
*/
|
|
53
|
-
removeChild(parent: RenderNode, child: RenderNode): void;
|
|
54
|
-
/**
|
|
55
|
-
* Create a text node
|
|
56
|
-
* @param text - The text content
|
|
57
|
-
* @returns The created text node
|
|
58
|
-
*/
|
|
59
|
-
createTextNode(text: string): RenderNode;
|
|
60
|
-
/**
|
|
61
|
-
* Update the text content of a text node
|
|
62
|
-
* @param node - The text node to update
|
|
63
|
-
* @param text - The new text content
|
|
64
|
-
*/
|
|
65
|
-
updateTextNode(node: RenderNode, text: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Add an event listener to a node
|
|
68
|
-
* @param node - The node to attach the listener to
|
|
69
|
-
* @param event - The event name (e.g., 'click', 'press')
|
|
70
|
-
* @param handler - The event handler function
|
|
71
|
-
*/
|
|
72
|
-
addEventListener(node: RenderNode, event: string, handler: EventHandler): void;
|
|
73
|
-
/**
|
|
74
|
-
* Remove an event listener from a node
|
|
75
|
-
* @param node - The node to remove the listener from
|
|
76
|
-
* @param event - The event name
|
|
77
|
-
* @param handler - The event handler function
|
|
78
|
-
*/
|
|
79
|
-
removeEventListener(node: RenderNode, event: string, handler: EventHandler): void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Platform-agnostic props that should be supported across all renderers
|
|
83
|
-
*/
|
|
84
|
-
interface CommonProps {
|
|
85
|
-
width?: number | string;
|
|
86
|
-
height?: number | string;
|
|
87
|
-
padding?: number;
|
|
88
|
-
paddingTop?: number;
|
|
89
|
-
paddingRight?: number;
|
|
90
|
-
paddingBottom?: number;
|
|
91
|
-
paddingLeft?: number;
|
|
92
|
-
margin?: number;
|
|
93
|
-
marginTop?: number;
|
|
94
|
-
marginRight?: number;
|
|
95
|
-
marginBottom?: number;
|
|
96
|
-
marginLeft?: number;
|
|
97
|
-
flexDirection?: 'row' | 'column';
|
|
98
|
-
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
99
|
-
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
100
|
-
gap?: number;
|
|
101
|
-
flex?: number;
|
|
102
|
-
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
103
|
-
bg?: string;
|
|
104
|
-
color?: string;
|
|
105
|
-
borderRadius?: number;
|
|
106
|
-
borderWidth?: number;
|
|
107
|
-
borderColor?: string;
|
|
108
|
-
opacity?: number;
|
|
109
|
-
fontSize?: number;
|
|
110
|
-
fontWeight?: number | string;
|
|
111
|
-
fontFamily?: string;
|
|
112
|
-
lineHeight?: number;
|
|
113
|
-
textAlign?: 'left' | 'center' | 'right';
|
|
114
|
-
onPress?: EventHandler;
|
|
115
|
-
onHover?: EventHandler;
|
|
116
|
-
onChange?: EventHandler;
|
|
117
|
-
onFocus?: EventHandler;
|
|
118
|
-
onBlur?: EventHandler;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Child types that can be rendered
|
|
122
|
-
*/
|
|
123
|
-
type FNodeChild = FNode | string | number | boolean | null | undefined | FNodeChild[];
|
|
124
|
-
/**
|
|
125
|
-
* Flexium Node - lightweight element descriptor for JSX
|
|
126
|
-
* (Not a Virtual DOM - just a simple descriptor that gets immediately converted to real DOM)
|
|
127
|
-
*/
|
|
128
|
-
interface FNode {
|
|
129
|
-
type: string | Function;
|
|
130
|
-
props: Record<string, unknown>;
|
|
131
|
-
children: FNodeChild[];
|
|
132
|
-
key?: string | number;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export type { CommonProps as C, EventHandler as E, FNode as F, Renderer as R, FNodeChild as a };
|
package/dist/server.d.cts
DELETED
package/dist/server.d.ts
DELETED
package/dist/server.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkXJHWMHKF_js=require('./chunk-XJHWMHKF.js');require('./chunk-YPVRQKMW.js'),require('./chunk-WWEWRI6S.js'),require('./chunk-GYDP6MFV.js');var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(chunkXJHWMHKF_js.g(r))return s(r());if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}exports.renderToString=s;//# sourceMappingURL=server.js.map
|
|
2
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value","styleStr","k","v","str"],"mappings":"8JAEA,IAAMA,CAAAA,CAAgB,IAAI,GAAA,CAAI,CAC5B,OACA,MAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,MAAA,CACA,OACA,OAAA,CACA,QAAA,CACA,OAAA,CACA,KACF,CAAC,CAAA,CAGM,SAASC,CAAAA,CAAeC,EAAmB,CAChD,GAAIA,CAAAA,EAAS,IAAA,EAA8BA,IAAS,KAAA,CAClD,OAAO,EAAA,CAGT,GAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAC9C,OAAOC,CAAAA,CAAW,MAAA,CAAOD,CAAI,CAAC,CAAA,CAGhC,GAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CACpB,OAAOA,EAAK,GA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,CAAA,CACpB,OAAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.js","sourcesContent":["import { isSignal } from '../core/state'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString((node as any)())\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n"]}
|
package/dist/server.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {g as g$1}from'./chunk-BBNYMXE7.mjs';import'./chunk-FDMJHFN7.mjs';import'./chunk-HB5VPQTB.mjs';import'./chunk-ECYYIQEX.mjs';var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(g$1(r))return s(r());if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export{s as renderToString};//# sourceMappingURL=server.mjs.map
|
|
2
|
-
//# sourceMappingURL=server.mjs.map
|
package/dist/server.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value","styleStr","k","v","str"],"mappings":"mIAEA,IAAMA,CAAAA,CAAgB,IAAI,GAAA,CAAI,CAC5B,OACA,MAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,MAAA,CACA,OACA,OAAA,CACA,QAAA,CACA,OAAA,CACA,KACF,CAAC,CAAA,CAGM,SAASC,CAAAA,CAAeC,EAAmB,CAChD,GAAIA,CAAAA,EAAS,IAAA,EAA8BA,IAAS,KAAA,CAClD,OAAO,EAAA,CAGT,GAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAC9C,OAAOC,CAAAA,CAAW,MAAA,CAAOD,CAAI,CAAC,CAAA,CAGhC,GAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CACpB,OAAOA,EAAK,GAAA,CAAID,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CAGzC,GAAIG,GAAAA,CAASF,CAAI,CAAA,CACf,OAAOD,CAAAA,CAAgBC,CAAAA,EAAc,CAAA,CAIvC,GAAIA,CAAAA,CAAK,IAAA,GAAS,MAAQA,CAAAA,CAAK,IAAA,GAAS,UAAA,CAAY,CAClD,IAAMG,CAAAA,CAAWH,CAAAA,CAAK,QAAA,EAAYA,EAAK,KAAA,EAAO,QAAA,CAC9C,OAAIG,CAAAA,CACK,KAAA,CAAM,OAAA,CAAQA,CAAQ,CAAA,CACzBA,EAAS,GAAA,CAAIJ,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CACpCA,CAAAA,CAAeI,CAAQ,EAEtB,EACT,CAEA,GAAI,OAAOH,EAAK,IAAA,EAAS,UAAA,CAAY,CACnC,IAAMI,EAASJ,CAAAA,CAAK,IAAA,CAAK,CAAE,GAAGA,C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AA,CAAA,EAAIC,CAAG,KAAKP,CAAAA,CAAW,MAAA,CAAOQ,CAAK,CAAC,CAAC,CAAA,CAAA,EAEjD,CAGF,OAAIX,EAAc,GAAA,CAAIO,CAAI,CAAA,CACxBE,CAAAA,EAAQ,IAAA,EAERA,CAAAA,EAAQ,GAAA,CACJJ,CAAAA,GACFI,GAAQ,KAAA,CAAM,OAAA,CAAQJ,CAAQ,CAAA,CAC1BA,EAAS,GAAA,CAAIJ,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CACpCA,CAAAA,CAAeI,CAAQ,CAAA,CAAA,CAE7BI,CAAAA,EAAQ,CAAA,EAAA,EAAKF,CAAI,CAAA,CAAA,CAAA,CAAA,CAGZE,CACT,CAEA,OAAO,EACT,CAEA,SAASN,CAAAA,CAAWY,CAAAA,CAAqB,CACvC,OAAOA,EACJ,OAAA,CAAQ,IAAA,CAAM,OAAO,CAAA,CACrB,OAAA,CAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,QAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,OAAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.mjs","sourcesContent":["import { isSignal } from '../core/state'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString((node as any)())\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n"]}
|