x-surface
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

x-surface

Infinitely pannable and zoomable HTML surface as a Web Component.

npm i x-surface pnpm add x-surface yarn add x-surface

Examples

# web
    # view source example/web.tsx

    /** @jsxImportSource sigl */
    import { Rect } from 'sigl'
    import $ from 'sigl'
    import { SurfaceElement, SurfaceItemElement, SurfaceMoveElement, SurfaceResizeElement } from 'x-surface'
    
    interface ItemElement extends $.Element<ItemElement> {}
    
    @$.element()
    class ItemElement extends $(SurfaceItemElement) {
      SurfaceMove = $.element(SurfaceMoveElement)
      SurfaceResize = $.element(SurfaceResizeElement)
      mounted($: ItemElement['$']) {
        $.render(({ host, surface, SurfaceMove, SurfaceResize }) => (
          <>
            <style>
              {/*css*/ `
              :host {
                box-sizing: border-box;
                border: 2px solid pink;
                display: block;
                position: absolute;
              }
    
              ${SurfaceMove} {
                background: #067;
                width: 100%;
                height: 20px;
                position: absolute;
              }
    
              ${SurfaceResize} {
                background: #ba2;
                position: absolute;
                right: 0;
                bottom: 0;
                width: 20px;
                height: 20px;
              }
              `}
            </style>
            <SurfaceMove surface={surface} dest={host} />
            <SurfaceResize surface={surface} dest={host} />
          </>
        ))
      }
    }
    
    interface SceneElement extends $.Element<SceneElement> {}
    
    @$.element()
    class SceneElement extends HTMLElement {
      Surface = $.element(SurfaceElement)
      Item = $.element(ItemElement)
    
      surface?: SurfaceElement
    
      items = new $.RefSet<ItemElement>([
        { rect: new Rect(0, 0, 500, 500) },
        { rect: new Rect(600, 0, 500, 500) },
      ])
    
      mounted($: this['$']) {
        $.render(({ Surface, Item, items }) => (
          <Surface ref={$.ref.surface}>
            {items.map(item => <Item {x-surface.item} />)}
          </Surface>
        ))
    
        // $.effect(({ surface }) => {
        setTimeout(() => {
          const ev = new WheelEvent('wheel', {
            deltaY: -800,
          })
          Object.defineProperty(ev, 'pageX', { value: 250 })
          Object.defineProperty(ev, 'pageY', { value: 150 })
          window.dispatchEvent(ev)
        }, 500)
        // })
      }
    }
    
    const Scene = $.element(SceneElement)
    
    $.render(
      <>
        <style>
          {/*css*/ `
          ${Scene} {
            display: block;
            width: 100%;
            height: 100%;
            position: fixed;
          }
        `}
        </style>
        <Scene />
      </>,
      document.body
    )

API

# SurfaceElement src/surface.tsx#L273

} & __module & {

# Boolean

    undefined | boolean

# Number

    undefined | number

# String

    undefined | string

}, "transition">>
# Grid  =  ... src/surface.tsx#L281
# Minimap  =  ... src/surface.tsx#L280
# __#2@#offsetHeight

    number

# __#2@#offsetLeft

    number

# __#2@#offsetTop

    number

# __#2@#offsetWidth

    number

# centerItem src/surface.tsx#L322
# centerOtherItem src/surface.tsx#L324

    # (diff)

      # diff

        number

      (diff)  =>

        void

# centerRect src/surface.tsx#L320

    # (rect)

      # rect

        Rect

      (rect)  =>

        void

# centerView src/surface.tsx#L326
# centeredItem src/surface.tsx#L318

    HTMLElement

# context

    ContextClass<SurfaceElement & JsxContext<SurfaceElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# cursorState  =  ... src/surface.tsx#L288

    State<SurfaceElement, {

    # Copy  =  'copy' src/surface.tsx#L48

      "copy"

    # EWResize  =  'ew-resize' src/surface.tsx#L51

      "ew-resize"

    # Grabbing  =  'grabbing' src/surface.tsx#L49

      "grabbing"

    # Idle  =  'default' src/surface.tsx#L46

      "default"

    # NSResize  =  'ns-resize' src/surface.tsx#L52

      "ns-resize"

    # NWSEResize  =  'nwse-resize' src/surface.tsx#L53

      "nwse-resize"

    }, "copy" | "default" | "grabbing" | "ew-resize" | "ns-resize" | "nwse-resize"> & EventMethods<SurfaceElement, {

    # copycancel

      CustomEvent<any>

    # copyend

      CustomEvent<any>

    # copypause

      CustomEvent<any>

    # copyresume

      CustomEvent<any>

    # copystart

      CustomEvent<any>

    # defaultcancel

      CustomEvent<any>

    # defaultend

      CustomEvent<any>

    # defaultpause

      CustomEvent<any>

    # defaultresume

      CustomEvent<any>

    # defaultstart

      CustomEvent<any>

    # ew-resizecancel

      CustomEvent<any>

    # ew-resizeend

      CustomEvent<any>

    # ew-resizepause

      CustomEvent<any>

    # ew-resizeresume

      CustomEvent<any>

    # ew-resizestart

      CustomEvent<any>

    # grabbingcancel

      CustomEvent<any>

    # grabbingend

      CustomEvent<any>

    # grabbingpause

      CustomEvent<any>

    # grabbingresume

      CustomEvent<any>

    # grabbingstart

      CustomEvent<any>

    # ns-resizecancel

      CustomEvent<any>

    # ns-resizeend

      CustomEvent<any>

    # ns-resizepause

      CustomEvent<any>

    # ns-resizeresume

      CustomEvent<any>

    # ns-resizestart

      CustomEvent<any>

    # nwse-resizecancel

      CustomEvent<any>

    # nwse-resizeend

      CustomEvent<any>

    # nwse-resizepause

      CustomEvent<any>

    # nwse-resizeresume

      CustomEvent<any>

    # nwse-resizestart

      CustomEvent<any>

    }> & InlineEventMap<SurfaceElement, {

    # copycancel

      CustomEvent<any>

    # copyend

      CustomEvent<any>

    # copypause

      CustomEvent<any>

    # copyresume

      CustomEvent<any>

    # copystart

      CustomEvent<any>

    # defaultcancel

      CustomEvent<any>

    # defaultend

      CustomEvent<any>

    # defaultpause

      CustomEvent<any>

    # defaultresume

      CustomEvent<any>

    # defaultstart

      CustomEvent<any>

    # ew-resizecancel

      CustomEvent<any>

    # ew-resizeend

      CustomEvent<any>

    # ew-resizepause

      CustomEvent<any>

    # ew-resizeresume

      CustomEvent<any>

    # ew-resizestart

      CustomEvent<any>

    # grabbingcancel

      CustomEvent<any>

    # grabbingend

      CustomEvent<any>

    # grabbingpause

      CustomEvent<any>

    # grabbingresume

      CustomEvent<any>

    # grabbingstart

      CustomEvent<any>

    # ns-resizecancel

      CustomEvent<any>

    # ns-resizeend

      CustomEvent<any>

    # ns-resizepause

      CustomEvent<any>

    # ns-resizeresume

      CustomEvent<any>

    # ns-resizestart

      CustomEvent<any>

    # nwse-resizecancel

      CustomEvent<any>

    # nwse-resizeend

      CustomEvent<any>

    # nwse-resizepause

      CustomEvent<any>

    # nwse-resizeresume

      CustomEvent<any>

    # nwse-resizestart

      CustomEvent<any>

    }>
# didCenterLast  =  'view' src/surface.tsx#L330

    "item" | "view"

# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# exitFullSize src/surface.tsx#L353

    null |

    # ()

      ()  =>

        void

# fullSize src/surface.tsx#L352

    HTMLElement

# getCenterMatrix src/surface.tsx#L328

    # (rect, paddingPct)

      # rect

        Rect

      # paddingPct

        number

      (rect, paddingPct)  =>

        DOMMatrix

# getPointerPos src/surface.tsx#L344

    # (event)

      # event

        PointerEvent | WheelEvent

      (event)  =>

        Point

# gridCellSize  =  80 src/surface.tsx#L291

    number

# host
# hoveringItem src/surface.tsx#L337
# items  =  ... src/surface.tsx#L333
# makeFullSize  =  ... src/surface.tsx#L354
# maxZoom  =  1.25 src/surface.tsx#L294

    number

# minZoom  =  0.05 src/surface.tsx#L293

    number

# minimap src/surface.tsx#L305
# minimapRatio  =  ... src/surface.tsx#L298

    number

# minimapScale  =  0.2 src/surface.tsx#L297

    number

# onconnectend
# onconnectstart
# onmounted
# onstatechange
# onsurfacemoveitemmove
# onsurfacemoveitemmoveend
# onsurfacemoveitemmovestart
# onsurfaceresizeitemresize
# onsurfaceresizeitemresizeend
# onsurfaceresizeitemresizestart
# onsurfaceselecting
# onunmounted
# ownRect

    Rect

# pinchStartDistance  =  1 src/surface.tsx#L343

    number

# pinchStartMatrix src/surface.tsx#L342

    null | DOMMatrix

# pixelRatio  =  window.devicePixelRatio src/surface.tsx#L290

    number

# pointer src/surface.tsx#L340
# pointers  =  ... src/surface.tsx#L341

    Map<number, Point>

# pos

    Point

# rect

    Rect

# root  =  ... src/surface.tsx#L284

    ShadowRoot

# selectingRect src/surface.tsx#L348

    null | Rect

# selectingStartPos src/surface.tsx#L349

    null | Point

# selection src/surface.tsx#L347

    HTMLDivElement

# setViewStyleTransform src/surface.tsx#L389

    # (matrixString)

      # matrixString

        string

      (matrixString)  =>

        void

# size

    Point

# snapThreshold  =  0.15 src/surface.tsx#L292

    number

# state  =  ... src/surface.tsx#L287

    State<SurfaceElement, {

    # CenteringItem  =  'surfacecenteringitem' src/surface.tsx#L34

      "surfacecenteringitem"

    # CenteringView  =  'surfacecenteringview' src/surface.tsx#L35

      "surfacecenteringview"

    # Connecting  =  'surfaceconnecting' src/surface.tsx#L36

      "surfaceconnecting"

    # FullSize  =  'surfacefullsize' src/surface.tsx#L37

      "surfacefullsize"

    # Idle  =  'surfaceidle' src/surface.tsx#L30

      "surfaceidle"

    # MinimapPanning  =  'surfaceminimappanning' src/surface.tsx#L38

      "surfaceminimappanning"

    # Overlay  =  'surfaceoverlay' src/surface.tsx#L32

      "surfaceoverlay"

    # Panning  =  'surfacepanning' src/surface.tsx#L39

      "surfacepanning"

    # Pinching  =  'surfacepinching' src/surface.tsx#L40

      "surfacepinching"

    # Selecting  =  'surfaceselecting' src/surface.tsx#L41

      "surfaceselecting"

    # Wheeling  =  'surfacewheeling' src/surface.tsx#L42

      "surfacewheeling"

    }, "surfaceselecting" | "surfaceidle" | "surfaceoverlay" | "surfacecenteringitem" | "surfacecenteringview" | "surfaceconnecting" | "surfacefullsize" | "surfaceminimappanning" | "surfacepanning" | "surfacepinching" | "surfacewheeling"> & EventMethods<SurfaceElement, {

    # surfacecenteringitemcancel

      CustomEvent<any>

    # surfacecenteringitemend

      CustomEvent<any>

    # surfacecenteringitempause

      CustomEvent<any>

    # surfacecenteringitemresume

      CustomEvent<any>

    # surfacecenteringitemstart

      CustomEvent<any>

    # surfacecenteringviewcancel

      CustomEvent<any>

    # surfacecenteringviewend

      CustomEvent<any>

    # surfacecenteringviewpause

      CustomEvent<any>

    # surfacecenteringviewresume

      CustomEvent<any>

    # surfacecenteringviewstart

      CustomEvent<any>

    # surfaceconnectingcancel

      CustomEvent<any>

    # surfaceconnectingend

      CustomEvent<any>

    # surfaceconnectingpause

      CustomEvent<any>

    # surfaceconnectingresume

      CustomEvent<any>

    # surfaceconnectingstart

      CustomEvent<any>

    # surfacefullsizecancel

      CustomEvent<any>

    # surfacefullsizeend

      CustomEvent<any>

    # surfacefullsizepause

      CustomEvent<any>

    # surfacefullsizeresume

      CustomEvent<any>

    # surfacefullsizestart

      CustomEvent<any>

    # surfaceidlecancel

      CustomEvent<any>

    # surfaceidleend

      CustomEvent<any>

    # surfaceidlepause

      CustomEvent<any>

    # surfaceidleresume

      CustomEvent<any>

    # surfaceidlestart

      CustomEvent<any>

    # surfaceminimappanningcancel

      CustomEvent<any>

    # surfaceminimappanningend

      CustomEvent<any>

    # surfaceminimappanningpause

      CustomEvent<any>

    # surfaceminimappanningresume

      CustomEvent<any>

    # surfaceminimappanningstart

      CustomEvent<any>

    # surfaceoverlaycancel

      CustomEvent<any>

    # surfaceoverlayend

      CustomEvent<any>

    # surfaceoverlaypause

      CustomEvent<any>

    # surfaceoverlayresume

      CustomEvent<any>

    # surfaceoverlaystart

      CustomEvent<any>

    # surfacepanningcancel

      CustomEvent<any>

    # surfacepanningend

      CustomEvent<any>

    # surfacepanningpause

      CustomEvent<any>

    # surfacepanningresume

      CustomEvent<any>

    # surfacepanningstart

      CustomEvent<any>

    # surfacepinchingcancel

      CustomEvent<any>

    # surfacepinchingend

      CustomEvent<any>

    # surfacepinchingpause

      CustomEvent<any>

    # surfacepinchingresume

      CustomEvent<any>

    # surfacepinchingstart

      CustomEvent<any>

    # surfaceselectingcancel

      CustomEvent<any>

    # surfaceselectingend

      CustomEvent<any>

    # surfaceselectingpause

      CustomEvent<any>

    # surfaceselectingresume

      CustomEvent<any>

    # surfaceselectingstart

      CustomEvent<any>

    # surfacewheelingcancel

      CustomEvent<any>

    # surfacewheelingend

      CustomEvent<any>

    # surfacewheelingpause

      CustomEvent<any>

    # surfacewheelingresume

      CustomEvent<any>

    # surfacewheelingstart

      CustomEvent<any>

    }> & InlineEventMap<SurfaceElement, {

    # surfacecenteringitemcancel

      CustomEvent<any>

    # surfacecenteringitemend

      CustomEvent<any>

    # surfacecenteringitempause

      CustomEvent<any>

    # surfacecenteringitemresume

      CustomEvent<any>

    # surfacecenteringitemstart

      CustomEvent<any>

    # surfacecenteringviewcancel

      CustomEvent<any>

    # surfacecenteringviewend

      CustomEvent<any>

    # surfacecenteringviewpause

      CustomEvent<any>

    # surfacecenteringviewresume

      CustomEvent<any>

    # surfacecenteringviewstart

      CustomEvent<any>

    # surfaceconnectingcancel

      CustomEvent<any>

    # surfaceconnectingend

      CustomEvent<any>

    # surfaceconnectingpause

      CustomEvent<any>

    # surfaceconnectingresume

      CustomEvent<any>

    # surfaceconnectingstart

      CustomEvent<any>

    # surfacefullsizecancel

      CustomEvent<any>

    # surfacefullsizeend

      CustomEvent<any>

    # surfacefullsizepause

      CustomEvent<any>

    # surfacefullsizeresume

      CustomEvent<any>

    # surfacefullsizestart

      CustomEvent<any>

    # surfaceidlecancel

      CustomEvent<any>

    # surfaceidleend

      CustomEvent<any>

    # surfaceidlepause

      CustomEvent<any>

    # surfaceidleresume

      CustomEvent<any>

    # surfaceidlestart

      CustomEvent<any>

    # surfaceminimappanningcancel

      CustomEvent<any>

    # surfaceminimappanningend

      CustomEvent<any>

    # surfaceminimappanningpause

      CustomEvent<any>

    # surfaceminimappanningresume

      CustomEvent<any>

    # surfaceminimappanningstart

      CustomEvent<any>

    # surfaceoverlaycancel

      CustomEvent<any>

    # surfaceoverlayend

      CustomEvent<any>

    # surfaceoverlaypause

      CustomEvent<any>

    # surfaceoverlayresume

      CustomEvent<any>

    # surfaceoverlaystart

      CustomEvent<any>

    # surfacepanningcancel

      CustomEvent<any>

    # surfacepanningend

      CustomEvent<any>

    # surfacepanningpause

      CustomEvent<any>

    # surfacepanningresume

      CustomEvent<any>

    # surfacepanningstart

      CustomEvent<any>

    # surfacepinchingcancel

      CustomEvent<any>

    # surfacepinchingend

      CustomEvent<any>

    # surfacepinchingpause

      CustomEvent<any>

    # surfacepinchingresume

      CustomEvent<any>

    # surfacepinchingstart

      CustomEvent<any>

    # surfaceselectingcancel

      CustomEvent<any>

    # surfaceselectingend

      CustomEvent<any>

    # surfaceselectingpause

      CustomEvent<any>

    # surfaceselectingresume

      CustomEvent<any>

    # surfaceselectingstart

      CustomEvent<any>

    # surfacewheelingcancel

      CustomEvent<any>

    # surfacewheelingend

      CustomEvent<any>

    # surfacewheelingpause

      CustomEvent<any>

    # surfacewheelingresume

      CustomEvent<any>

    # surfacewheelingstart

      CustomEvent<any>

    }>
# transition  =  ... src/surface.tsx#L289

    Transition<States, "surfaceselecting" | "surfaceidle" | "surfaceoverlay" | "surfacecenteringitem" | "surfacecenteringview" | "surfaceconnecting" | "surfacefullsize" | "surfaceminimappanning" | "surfacepanning" | "surfacepinching" | "surfacewheeling">

# view src/surface.tsx#L308

    HTMLSlotElement

# viewFrame src/surface.tsx#L309

    HTMLDivElement

# viewFrameNormalRect src/surface.tsx#L311

    Rect

# viewFrameRect src/surface.tsx#L310

    Rect

# viewMatrix  =  ... src/surface.tsx#L313

    DOMMatrix

# viewMatrixString src/surface.tsx#L314

    string

# viewRect src/surface.tsx#L312

    Rect

# viewStyleTransform src/surface.tsx#L315

    string

# xPattern  =  '1' src/surface.tsx#L301

    string

# yPattern  =  '1' src/surface.tsx#L302

    string

# zIndex  =  0 src/surface.tsx#L277

    number

# matrix src/surface.tsx#L391
# __#2@#updateOffsets()

    __#2@#updateOffsets()  =>

      void
# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface.tsx#L395

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)
} & SurfaceMoveEvents & SurfaceResizeEvents [K]> ], Off>>
# toJSON()
# SurfaceGridElement src/surface-grid.ts#L20
# anim src/surface-grid.ts#L42
# animValues src/surface-grid.ts#L43
# canvas src/surface-grid.ts#L39

    HTMLCanvasElement

# cellSize  =  80 src/surface-grid.ts#L27

    number

# context

    ContextClass<SurfaceGridElement & JsxContext<SurfaceGridElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# ctx src/surface-grid.ts#L40

    CanvasRenderingContext2D

# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# host
# matrix src/surface-grid.ts#L32

    DOMMatrix

# offsetX src/surface-grid.ts#L46

    number

# offsetY src/surface-grid.ts#L47

    number

# onmounted
# onunmounted
# pixelRatio  =  window.devicePixelRatio src/surface-grid.ts#L26

    number

# pointers  =  ... src/surface-grid.ts#L34

    Map<number, Point>

# rect src/surface-grid.ts#L33

    Rect

# root  =  ... src/surface-grid.ts#L24

    ShadowRoot

# slotted src/surface-grid.ts#L35

    HTMLElement []

# transition src/surface-grid.ts#L36

    Transition<States, unknown>

# xPattern  =  '1' src/surface-grid.ts#L28

    string

# yPattern  =  '1' src/surface-grid.ts#L29

    string

# zoom src/surface-grid.ts#L45

    number

# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface-grid.ts#L49

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)

    # name

    on<K>(name)  =>

# toJSON()
# SurfaceItemElement src/surface-item.ts#L6
# context

    ContextClass<SurfaceItemElement & JsxContext<SurfaceItemElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# host
# onmounted
# onunmounted
# points src/surface-item.ts#L15

    Point []

# pos  =  ... src/surface-item.ts#L11

    Point

# rect  =  ... src/surface-item.ts#L10

    Rect

# size  =  ... src/surface-item.ts#L12

    Point

# surface src/surface-item.ts#L14
# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface-item.ts#L17

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)

    # name

    on<K>(name)  =>

# toJSON()
# SurfaceMinimapElement src/surface-minimap.ts#L32
# allVisible  =  true src/surface-minimap.ts#L55

    boolean

# canvas  =  ... src/surface-minimap.ts#L47

    HTMLCanvasElement

# context

    ContextClass<SurfaceMinimapElement & JsxContext<SurfaceMinimapElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# ctx  =  ... src/surface-minimap.ts#L48

    CanvasRenderingContext2D

# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# host
# isOverMinimap  =  ... src/surface-minimap.ts#L49

    boolean

# items src/surface-minimap.ts#L45
# matrix src/surface-minimap.ts#L43

    DOMMatrix

# onmounted
# onunmounted
# pixelRatio  =  window.devicePixelRatio src/surface-minimap.ts#L38

    number

# ratio  =  ... src/surface-minimap.ts#L40

    number

# rect src/surface-minimap.ts#L44

    Rect

# root  =  ... src/surface-minimap.ts#L36

    ShadowRoot

# scale  =  0.2 src/surface-minimap.ts#L39

    number

# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface-minimap.ts#L57

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)
# toJSON()
# SurfaceMoveElement src/surface-move.ts#L24
# context

    ContextClass<SurfaceMoveElement & JsxContext<SurfaceMoveElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# dest src/surface-move.ts#L37
# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# grabPos src/surface-move.ts#L40

    null | Point

# host
# onmounted
# onsurfacemoveitemmove
# onsurfacemoveitemmoveend
# onsurfacemoveitemmovestart
# onunmounted
# pointerId src/surface-move.ts#L39

    number

# root  =  ... src/surface-move.ts#L28

    ShadowRoot

# state  =  ... src/surface-move.ts#L34

    State<SurfaceMoveElement, {

    # Idle  =  'surfacemoveidle' src/surface-move.ts#L20

      "surfacemoveidle"

    # ItemMove  =  'surfacemoveitemmove' src/surface-move.ts#L21

      "surfacemoveitemmove"

    }, "surfacemoveitemmove" | "surfacemoveidle"> & EventMethods<SurfaceMoveElement, {

    # surfacemoveidlecancel

      CustomEvent<any>

    # surfacemoveidleend

      CustomEvent<any>

    # surfacemoveidlepause

      CustomEvent<any>

    # surfacemoveidleresume

      CustomEvent<any>

    # surfacemoveidlestart

      CustomEvent<any>

    # surfacemoveitemmovecancel

      CustomEvent<any>

    # surfacemoveitemmoveend

      CustomEvent<any>

    # surfacemoveitemmovepause

      CustomEvent<any>

    # surfacemoveitemmoveresume

      CustomEvent<any>

    # surfacemoveitemmovestart

      CustomEvent<any>

    }> & InlineEventMap<SurfaceMoveElement, {

    # surfacemoveidlecancel

      CustomEvent<any>

    # surfacemoveidleend

      CustomEvent<any>

    # surfacemoveidlepause

      CustomEvent<any>

    # surfacemoveidleresume

      CustomEvent<any>

    # surfacemoveidlestart

      CustomEvent<any>

    # surfacemoveitemmovecancel

      CustomEvent<any>

    # surfacemoveitemmoveend

      CustomEvent<any>

    # surfacemoveitemmovepause

      CustomEvent<any>

    # surfacemoveitemmoveresume

      CustomEvent<any>

    # surfacemoveitemmovestart

      CustomEvent<any>

    }>
# surface src/surface-move.ts#L36
# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface-move.ts#L42

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)
# toJSON()
# SurfaceResizeElement src/surface-resize.ts#L24
# context

    ContextClass<SurfaceResizeElement & JsxContext<SurfaceResizeElement> & Omit<{

    # ctor

      Class<T>

    <T>(ctor)  =>

      CleanClass<T>
    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>
# dest src/surface-resize.ts#L37
# dispatch

    Dispatch<

    # (name, detail, init)

      # name

        Event | Narrow<K, string>

      # detail
      # init

        CustomEventInit<any>

      <K, E>(name, detail, init)  =>

        any

>
# grabPos src/surface-resize.ts#L40

    null | Point

# host
# onmounted
# onsurfaceresizeitemresize
# onsurfaceresizeitemresizeend
# onsurfaceresizeitemresizestart
# onunmounted
# orig src/surface-resize.ts#L41

    null | Rect

# pointerId src/surface-resize.ts#L39

    number

# root  =  ... src/surface-resize.ts#L28

    ShadowRoot

# state  =  ... src/surface-resize.ts#L34

    State<SurfaceResizeElement, {

    # Idle  =  'surfaceresizeidle' src/surface-resize.ts#L20

      "surfaceresizeidle"

    # ItemResize  =  'surfaceresizeitemresize' src/surface-resize.ts#L21

      "surfaceresizeitemresize"

    }, "surfaceresizeitemresize" | "surfaceresizeidle"> & EventMethods<SurfaceResizeElement, {

    # surfaceresizeidlecancel

      CustomEvent<any>

    # surfaceresizeidleend

      CustomEvent<any>

    # surfaceresizeidlepause

      CustomEvent<any>

    # surfaceresizeidleresume

      CustomEvent<any>

    # surfaceresizeidlestart

      CustomEvent<any>

    # surfaceresizeitemresizecancel

      CustomEvent<any>

    # surfaceresizeitemresizeend

      CustomEvent<any>

    # surfaceresizeitemresizepause

      CustomEvent<any>

    # surfaceresizeitemresizeresume

      CustomEvent<any>

    # surfaceresizeitemresizestart

      CustomEvent<any>

    }> & InlineEventMap<SurfaceResizeElement, {

    # surfaceresizeidlecancel

      CustomEvent<any>

    # surfaceresizeidleend

      CustomEvent<any>

    # surfaceresizeidlepause

      CustomEvent<any>

    # surfaceresizeidleresume

      CustomEvent<any>

    # surfaceresizeidlestart

      CustomEvent<any>

    # surfaceresizeitemresizecancel

      CustomEvent<any>

    # surfaceresizeitemresizeend

      CustomEvent<any>

    # surfaceresizeitemresizepause

      CustomEvent<any>

    # surfaceresizeitemresizeresume

      CustomEvent<any>

    # surfaceresizeitemresizestart

      CustomEvent<any>

    }>
# surface src/surface-resize.ts#L36
# created(ctx)

    # ctx

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

created(ctx)  =>

    void
# mounted($) src/surface-resize.ts#L43

    # $

    # ctx

      T | Class<T>

    <T>(ctx)  =>

      Wrapper<T>
    } & __module & {

    # Boolean

      undefined | boolean

    # Number

      undefined | number

    # String

      undefined | string

    }, "transition">>

mounted($)  =>

    void
# on(name)
# toJSON()
# SurfaceEvents src/surface.tsx#L17
} & SurfaceMoveEvents & SurfaceResizeEvents
# SurfaceMoveDetail src/surface-move.ts#L8
# SurfaceMoveEvents src/surface-move.ts#L13
# SurfaceResizeDetail src/surface-resize.ts#L8
# SurfaceResizeEvents src/surface-resize.ts#L13
# SurfaceAnimSettings  =  ... src/surface.tsx#L76
# SurfaceCursorState  =  ... src/surface.tsx#L45
# SurfaceMoveState  =  ... src/surface-move.ts#L19
# SurfaceResizeState  =  ... src/surface-resize.ts#L19
# SurfaceState  =  ... src/surface.tsx#L29

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Readme

Keywords

none

Package Sidebar

Install

npm i x-surface

Weekly Downloads

35

Version

1.1.0

License

MIT

Unpacked Size

1.91 MB

Total Files

48

Last publish

Collaborators

  • stagas